Skip to content

Commit

Permalink
Removed obsolete IIS express run profiles.
Browse files Browse the repository at this point in the history
Fixed async method signatures in tests.
Fixed copy/paste naming issues in Cancel Shopping Carts API tests
  • Loading branch information
oskardudycz committed Mar 13, 2022
1 parent e5614f1 commit 46570e5
Show file tree
Hide file tree
Showing 33 changed files with 26 additions and 215 deletions.
2 changes: 1 addition & 1 deletion CQRS.Tests/Queries/Queries.cs
Expand Up @@ -98,7 +98,7 @@ public Task<List<string>> Handle(GetIssuesNamesQuery query, CancellationToken ca
}

[Fact]
public async void GivenCommandWithData_WhenCommandIsSendToApplicationService_ThenreadModelIsChanged()
public async Task GivenCommandWithData_WhenCommandIsSendToApplicationService_ThenreadModelIsChanged()
{
var serviceLocator = new ServiceLocator();

Expand Down
2 changes: 1 addition & 1 deletion MediatR.Tests/Publishing/MoreThanOneHandler.cs
Expand Up @@ -69,7 +69,7 @@ public MoreThanOneHandler()
}

[Fact]
public async void GivenTwoHandlersForOneEvent_WhenPublishMethodIsBeingCalled_ThenTwoHandlersAreBeingCalled()
public async Task GivenTwoHandlersForOneEvent_WhenPublishMethodIsBeingCalled_ThenTwoHandlersAreBeingCalled()
{
//Given
var @event = new IssueCreated("cleaning");
Expand Down
2 changes: 1 addition & 1 deletion MediatR.Tests/Publishing/NoHandlers.cs
Expand Up @@ -39,7 +39,7 @@ public IssueCreated(string issueName)
}

[Fact]
public async void GivenNonRegisteredQueryHandler_WhenPublishMethodIsBeingCalled_ThenThrowsAnError()
public async Task GivenNonRegisteredQueryHandler_WhenPublishMethodIsBeingCalled_ThenThrowsAnError()
{
var ex = await Record.ExceptionAsync(async () =>
{
Expand Down
2 changes: 1 addition & 1 deletion MediatR.Tests/Publishing/SingleHandler.cs
Expand Up @@ -70,7 +70,7 @@ public SingleHandler()
}

[Fact]
public async void GivenRegisteredAsynchronousRequestHandler_WhenPublishMethodIsBeingCalled_ThenReturnsProperResult()
public async Task GivenRegisteredAsynchronousRequestHandler_WhenPublishMethodIsBeingCalled_ThenReturnsProperResult()
{
//Given
var @event = new IssueCreated("cleaning");
Expand Down
2 changes: 1 addition & 1 deletion MediatR.Tests/Sending/MoreThanOneHandler.cs
Expand Up @@ -70,7 +70,7 @@ public MoreThanOneHandler()
}

[Fact]
public async void GivenTwoHandlersForOneCommand_WhenSendMethodIsBeingCalled_ThenOnlyFIrstHandlersIsBeingCalled()
public async Task GivenTwoHandlersForOneCommand_WhenSendMethodIsBeingCalled_ThenOnlyFIrstHandlersIsBeingCalled()
{
//Given
var query = new CreateIssueCommand("cleaning");
Expand Down
2 changes: 1 addition & 1 deletion MediatR.Tests/Sending/NoHandlers.cs
Expand Up @@ -39,7 +39,7 @@ public GetIssuesNamesQuery(string filter)
}

[Fact]
public async void GivenNonRegisteredQueryHandler_WhenSendMethodIsBeingCalled_ThenThrowsAnError()
public async Task GivenNonRegisteredQueryHandler_WhenSendMethodIsBeingCalled_ThenThrowsAnError()
{
var ex = await Record.ExceptionAsync(async () =>
{
Expand Down
2 changes: 1 addition & 1 deletion MediatR.Tests/Sending/SingleHandler.cs
Expand Up @@ -71,7 +71,7 @@ public SingleHandler()
}

[Fact]
public async void GivenRegisteredAsynchronousRequestHandler_WhenSendMethodIsBeingCalled_ThenReturnsProperResult()
public async Task GivenRegisteredAsynchronousRequestHandler_WhenSendMethodIsBeingCalled_ThenReturnsProperResult()
{
//Given
var query = new GetIssuesNamesQuery("cleaning");
Expand Down
@@ -1,20 +1,5 @@
{
"iisSettings": {
"windowsAuthentication": false,
"anonymousAuthentication": true,
"iisExpress": {
"applicationUrl": "http://localhost:38472",
"sslPort": 44357
}
},
"profiles": {
"IIS Express": {
"commandName": "IISExpress",
"launchBrowser": true,
"environmentVariables": {
"ASPNETCORE_ENVIRONMENT": "Development"
}
},
"SmartHomeApi": {
"commandName": "Project",
"launchBrowser": true,
Expand Down
Expand Up @@ -47,12 +47,10 @@ public AddProductTests(AddProductFixture fixture)

[Fact]
[Trait("Category", "Acceptance")]
public Task Put_Should_Return_OK()
public void Put_Should_Return_OK()
{
var commandResponse = fixture.CommandResponse.EnsureSuccessStatusCode();
commandResponse.StatusCode.Should().Be(HttpStatusCode.OK);

return Task.CompletedTask;
}

[Fact]
Expand Down
Expand Up @@ -45,17 +45,15 @@ public ConfirmShoppingCartTests(ConfirmShoppingCartFixture fixture)

[Fact]
[Trait("Category", "Acceptance")]
public Task Put_Should_Return_OK()
public void Put_Should_Return_OK()
{
var commandResponse = fixture.CommandResponse.EnsureSuccessStatusCode();
commandResponse.StatusCode.Should().Be(HttpStatusCode.OK);

return Task.CompletedTask;
}

[Fact]
[Trait("Category", "Acceptance")]
public async Task Put_Should_Confirm_ShoppingCart()
public async Task Delete_Should_Cancel_ShoppingCart()
{
// prepare query
var query = $"{fixture.ShoppingCartId}";
Expand Down
Expand Up @@ -46,17 +46,15 @@ public ConfirmShoppingCartTests(ConfirmShoppingCartFixture fixture)

[Fact]
[Trait("Category", "Acceptance")]
public Task Put_Should_Return_OK()
public void Put_Should_Return_OK()
{
var commandResponse = fixture.CommandResponse.EnsureSuccessStatusCode();
commandResponse.StatusCode.Should().Be(HttpStatusCode.OK);

return Task.CompletedTask;
}

[Fact]
[Trait("Category", "Acceptance")]
public async Task Put_Should_Confirm_ShoppingCart()
public async Task Delete_Should_Cancel_ShoppingCart()
{
// prepare query
var query = $"{fixture.ShoppingCartId}";
Expand Down
Expand Up @@ -62,12 +62,10 @@ public RemoveProductTests(RemoveProductFixture fixture)

[Fact]
[Trait("Category", "Acceptance")]
public Task Delete_Should_Return_OK()
public void Delete_Should_Return_OK()
{
var commandResponse = fixture.CommandResponse.EnsureSuccessStatusCode();
commandResponse.StatusCode.Should().Be(HttpStatusCode.NoContent);

return Task.CompletedTask;
}

[Fact]
Expand Down
@@ -1,12 +1,4 @@
{
"iisSettings": {
"windowsAuthentication": false,
"anonymousAuthentication": true,
"iisExpress": {
"applicationUrl": "http://localhost:38471",
"sslPort": 44357
}
},
"profiles": {
"CartsApi": {
"commandName": "Project",
Expand Down
@@ -1,12 +1,4 @@
{
"iisSettings": {
"windowsAuthentication": false,
"anonymousAuthentication": true,
"iisExpress": {
"applicationUrl": "http://localhost:38471",
"sslPort": 44357
}
},
"profiles": {
"OrdersApi": {
"commandName": "Project",
Expand Down
5 changes: 1 addition & 4 deletions Sample/ECommerce/Orders/Orders/Orders/OrderSaga.cs
Expand Up @@ -74,9 +74,6 @@ public Task Handle(ProductWasOutOfStock @event, CancellationToken cancellationTo

public Task Handle(OrderCancelled @event, CancellationToken cancellationToken)
{
if (!@event.PaymentId.HasValue)
return Task.CompletedTask;

return commandBus.Send(DiscardPayment.Create(@event.PaymentId.Value));
return @event.PaymentId.HasValue ? commandBus.Send(DiscardPayment.Create(@event.PaymentId.Value)) : Task.CompletedTask;
}
}
@@ -1,12 +1,4 @@
{
"iisSettings": {
"windowsAuthentication": false,
"anonymousAuthentication": true,
"iisExpress": {
"applicationUrl": "http://localhost:38471",
"sslPort": 44357
}
},
"profiles": {
"PaymentsApi": {
"commandName": "Project",
Expand Down
@@ -1,12 +1,4 @@
{
"iisSettings": {
"windowsAuthentication": false,
"anonymousAuthentication": true,
"iisExpress": {
"applicationUrl": "http://localhost:38471",
"sslPort": 44357
}
},
"profiles": {
"ShipmentsApi": {
"commandName": "Project",
Expand Down
Expand Up @@ -46,12 +46,10 @@ public AddProductTests(AddProductFixture fixture)

[Fact]
[Trait("Category", "Acceptance")]
public Task Put_Should_Return_OK()
public void Put_Should_Return_OK()
{
var commandResponse = fixture.CommandResponse.EnsureSuccessStatusCode();
commandResponse.StatusCode.Should().Be(HttpStatusCode.OK);

return Task.CompletedTask;
}

[Fact]
Expand Down
Expand Up @@ -43,17 +43,15 @@ public CancelShoppingCartTests(CancelShoppingCartFixture fixture)

[Fact]
[Trait("Category", "Acceptance")]
public Task Put_Should_Return_OK()
public void Put_Should_Return_OK()
{
var commandResponse = fixture.CommandResponse.EnsureSuccessStatusCode();
commandResponse.StatusCode.Should().Be(HttpStatusCode.OK);

return Task.CompletedTask;
}

[Fact]
[Trait("Category", "Acceptance")]
public async Task Put_Should_Confirm_ShoppingCart()
public async Task Delete_Should_Cancel_ShoppingCart()
{
// prepare query
var query = $"{fixture.ShoppingCartId}";
Expand Down
Expand Up @@ -44,12 +44,10 @@ public ConfirmShoppingCartTests(ConfirmShoppingCartFixture fixture)

[Fact]
[Trait("Category", "Acceptance")]
public Task Put_Should_Return_OK()
public void Put_Should_Return_OK()
{
var commandResponse = fixture.CommandResponse.EnsureSuccessStatusCode();
commandResponse.StatusCode.Should().Be(HttpStatusCode.OK);

return Task.CompletedTask;
}

[Fact]
Expand Down
Expand Up @@ -61,12 +61,10 @@ public RemoveProductTests(RemoveProductFixture fixture)

[Fact]
[Trait("Category", "Acceptance")]
public Task Delete_Should_Return_OK()
public void Delete_Should_Return_OK()
{
var commandResponse = fixture.CommandResponse.EnsureSuccessStatusCode();
commandResponse.StatusCode.Should().Be(HttpStatusCode.NoContent);

return Task.CompletedTask;
}

[Fact]
Expand Down
@@ -1,12 +1,4 @@
{
"iisSettings": {
"windowsAuthentication": false,
"anonymousAuthentication": true,
"iisExpress": {
"applicationUrl": "http://localhost:38471",
"sslPort": 44357
}
},
"profiles": {
"CartsApi": {
"commandName": "Project",
Expand Down
Expand Up @@ -46,12 +46,10 @@ public AddProductTests(AddProductFixture fixture)

[Fact]
[Trait("Category", "Acceptance")]
public Task Put_Should_Return_OK()
public void Put_Should_Return_OK()
{
var commandResponse = fixture.CommandResponse.EnsureSuccessStatusCode();
commandResponse.StatusCode.Should().Be(HttpStatusCode.OK);

return Task.CompletedTask;
}

[Fact]
Expand Down
Expand Up @@ -43,17 +43,15 @@ public CancelShoppingCartTests(CancelShoppingCartFixture fixture)

[Fact]
[Trait("Category", "Acceptance")]
public Task Put_Should_Return_OK()
public void Put_Should_Return_OK()
{
var commandResponse = fixture.CommandResponse.EnsureSuccessStatusCode();
commandResponse.StatusCode.Should().Be(HttpStatusCode.OK);

return Task.CompletedTask;
}

[Fact]
[Trait("Category", "Acceptance")]
public async Task Put_Should_Confirm_ShoppingCart()
public async Task Delete_Should_Cancel_ShoppingCart()
{
// prepare query
var query = $"{fixture.ShoppingCartId}";
Expand Down
Expand Up @@ -44,12 +44,10 @@ public ConfirmShoppingCartTests(ConfirmShoppingCartFixture fixture)

[Fact]
[Trait("Category", "Acceptance")]
public Task Put_Should_Return_OK()
public void Put_Should_Return_OK()
{
var commandResponse = fixture.CommandResponse.EnsureSuccessStatusCode();
commandResponse.StatusCode.Should().Be(HttpStatusCode.OK);

return Task.CompletedTask;
}

[Fact]
Expand Down
Expand Up @@ -61,12 +61,10 @@ public RemoveProductTests(RemoveProductFixture fixture)

[Fact]
[Trait("Category", "Acceptance")]
public Task Delete_Should_Return_OK()
public void Delete_Should_Return_OK()
{
var commandResponse = fixture.CommandResponse.EnsureSuccessStatusCode();
commandResponse.StatusCode.Should().Be(HttpStatusCode.NoContent);

return Task.CompletedTask;
}

[Fact]
Expand Down
@@ -1,22 +1,6 @@
{
"$schema": "http://json.schemastore.org/launchsettings.json",
"iisSettings": {
"windowsAuthentication": false,
"anonymousAuthentication": true,
"iisExpress": {
"applicationUrl": "http://localhost:37117",
"sslPort": 44355
}
},
"profiles": {
"IIS Express": {
"commandName": "IISExpress",
"launchBrowser": true,
"launchUrl": "swagger",
"environmentVariables": {
"ASPNETCORE_ENVIRONMENT": "Development"
}
},
"ECommerce.Api": {
"commandName": "Project",
"dotnetRunMessages": "true",
Expand Down
@@ -1,20 +1,5 @@
{
"iisSettings": {
"windowsAuthentication": false,
"anonymousAuthentication": true,
"iisExpress": {
"applicationUrl": "http://localhost:38481",
"sslPort": 44357
}
},
"profiles": {
"IIS Express": {
"commandName": "IISExpress",
"launchBrowser": true,
"environmentVariables": {
"ASPNETCORE_ENVIRONMENT": "Development"
}
},
"MeetingsManagement.Api": {
"commandName": "Project",
"launchBrowser": true,
Expand Down

0 comments on commit 46570e5

Please sign in to comment.