@@ -12,19 +12,18 @@ public async Task Get_SaysHello()
12
12
{
13
13
// arrange
14
14
await using var application = new SiteApp ( ) ;
15
- using var client = application . CreateClient ( ) ;
15
+ using HttpClient client = application . CreateClient ( ) ;
16
16
17
17
// act
18
18
using var res = await client . GetAsync ( "/api/minimal?name=test" ) ;
19
19
var body = await res . Content . ReadAsStringAsync ( ) ;
20
20
MinimalModel ? model = JsonSerializer . Deserialize < MinimalModel > ( body , jsonOptions ) ;
21
21
22
22
// assert
23
- using var scope = new AssertionScope ( ) ;
24
- model . Should ( ) . NotBeNull ( ) ;
23
+ model . ShouldNotBeNull ( ) ;
25
24
ArgumentNullException . ThrowIfNull ( model ) ;
26
- model . Id . Should ( ) . Be ( 3 ) ;
27
- model . Message . Should ( ) . Be ( "Hello test" ) ;
25
+ model . Id . ShouldBe ( 3 ) ;
26
+ model . Message . ShouldBe ( "Hello test" ) ;
28
27
}
29
28
30
29
[ Fact ]
@@ -47,11 +46,10 @@ public async Task Post_SaysHello()
47
46
MinimalModel ? model = JsonSerializer . Deserialize < MinimalModel > ( body , jsonOptions ) ;
48
47
49
48
// assert
50
- using var scope = new AssertionScope ( ) ;
51
- model . Should ( ) . NotBeNull ( ) ;
49
+ model . ShouldNotBeNull ( ) ;
52
50
ArgumentNullException . ThrowIfNull ( model ) ;
53
- model . Message . Should ( ) . Be ( "Hello foo and 5" ) ;
54
- model . Data . Should ( ) . BeEquivalentTo ( expected ) ;
51
+ model . Message . ShouldBe ( "Hello foo and 5" ) ;
52
+ model . Data . ShouldBeEquivalentTo ( expected ) ;
55
53
}
56
54
57
55
}
0 commit comments