File tree Expand file tree Collapse file tree 1 file changed +2
-17
lines changed
Expand file tree Collapse file tree 1 file changed +2
-17
lines changed Original file line number Diff line number Diff line change 88using Newtonsoft . Json ;
99using Shouldly ;
1010using Wax . Api ;
11+ using Wax . Core . Domain . Customers . Exceptions ;
1112using Wax . Messages . Commands . Customers ;
1213using 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 }
You can’t perform that action at this time.
0 commit comments