Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Get by ID and Get All endpoints #2

Merged
merged 26 commits into from
Jun 28, 2021
Merged

Get by ID and Get All endpoints #2

merged 26 commits into from
Jun 28, 2021

Conversation

notatiyyah
Copy link
Collaborator

@notatiyyah notatiyyah commented Jun 17, 2021

Describe this PR

Create the 'Get All Technologies' endpoint and 'Get Technology by ID' endpoint

Checklist

  • Added relevant unit and end-to-end tests
  • Added tests to cover all new production code
  • Added a README
  • Checked all code for possible refactoring
  • Code pipeline builds correctly

Copy link
Contributor

@humulla humulla left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great start! There are some changes that need to be made as commented, please also change all tests to use the Xunit framework. Let me know if you have any questions

TechRadarApi/V1/Gateways/TechnologyGateway.cs Outdated Show resolved Hide resolved
TechRadarApi/V1/Controllers/TechRadarApiController.cs Outdated Show resolved Hide resolved
TechRadarApi.Tests/V1/Gateways/TechnologyGatewayTests.cs Outdated Show resolved Hide resolved
TechRadarApi.Tests/V1/Gateways/TechnologyGatewayTests.cs Outdated Show resolved Hide resolved
TechRadarApi.Tests/V1/E2ETests/GetByIdEndToEndTests.cs Outdated Show resolved Hide resolved
TechRadarApi.Tests/V1/E2ETests/GetAllEndToEndTests.cs Outdated Show resolved Hide resolved
[Test]
[Ignore("Getting a bug - can't stub the DB response")]

[Fact(Skip = "Cannot mock DynamoDb context")]
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why is this test skipped? what is the issue you are facing

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

mockDynamoDb.Setup(x => x.ScanAsync<TechnologyDbEntity>(conditions, default).GetRemainingAsync(default))
                     .ThrowsAsync(exception);

This line ^ doesn't work with the scan async method as it's a 'non-virtual method'. Here's a link for more info. Should I just remove the test?

// Act
var response = await Client.GetAsync(uri).ConfigureAwait(false);
// Assert
response.StatusCode.Should().Be(HttpStatusCode.NoContent);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should change to return an 200 response

TechRadarApi/V1/Controllers/TechRadarApiController.cs Outdated Show resolved Hide resolved
Copy link
Contributor

@humulla humulla left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me!

@notatiyyah notatiyyah merged commit 6724e74 into master Jun 28, 2021
@notatiyyah notatiyyah deleted the get-all-technologies branch July 6, 2021 11:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants