Skip to content

Commit 7ca39e9

Browse files
committed
Fix tests
1 parent 22689f4 commit 7ca39e9

File tree

1 file changed

+2
-17
lines changed

1 file changed

+2
-17
lines changed

tests/Wax.E2ETests/GlobalExceptionTests.cs

Lines changed: 2 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
using Newtonsoft.Json;
99
using Shouldly;
1010
using Wax.Api;
11+
using Wax.Core.Domain.Customers.Exceptions;
1112
using Wax.Messages.Commands.Customers;
1213
using Xunit;
1314

@@ -37,23 +38,6 @@ public async Task ShouldReturn400StatusCodeWhenInvalidCommand()
3738
problemDetails.Errors.Count.ShouldBeGreaterThanOrEqualTo(1);
3839
}
3940

40-
[Fact]
41-
public async Task ShouldReturn404StatusCodeWhenEntityNotFound()
42-
{
43-
var client = _factory.CreateClient();
44-
45-
var response = await client.GetAsync($"/customers/{Guid.NewGuid()}");
46-
47-
response.StatusCode.ShouldBe(HttpStatusCode.NotFound);
48-
49-
var content = await response.Content.ReadAsStringAsync();
50-
51-
var problemDetails = JsonConvert.DeserializeObject<ProblemDetails>(content);
52-
53-
problemDetails.Title.ShouldBe("The specified resource was not found.");
54-
problemDetails.Detail.ShouldStartWith("Entity not found");
55-
}
56-
5741
[Fact]
5842
public async Task ShouldReturn409StatusCodeWhenBusinessError()
5943
{
@@ -76,6 +60,7 @@ public async Task ShouldReturn409StatusCodeWhenBusinessError()
7660

7761
var problemDetails = JsonConvert.DeserializeObject<ProblemDetails>(content);
7862

63+
problemDetails.Type.ShouldBe(nameof(CustomerNameAlreadyExistsException));
7964
problemDetails.Title.ShouldBe("A business error occur.");
8065
problemDetails.Detail.ShouldBe("Customer with this name already exists.");
8166
}

0 commit comments

Comments
 (0)