44using MyApp . ServiceInterface ;
55using MyApp . ServiceModel ;
66
7- namespace MyApp . Tests
7+ namespace MyApp . Tests ;
8+
9+ public class IntegrationTest
810{
9- public class IntegrationTest
11+ const string BaseUri = "http://localhost:2000/" ;
12+ private readonly ServiceStackHost appHost ;
13+
14+ class AppHost : AppSelfHostBase
1015 {
11- const string BaseUri = "http://localhost:2000/" ;
12- private readonly ServiceStackHost appHost ;
16+ public AppHost ( ) : base ( nameof ( IntegrationTest ) , typeof ( MyServices ) . Assembly ) { }
1317
14- class AppHost : AppSelfHostBase
18+ public override void Configure ( Container container )
1519 {
16- public AppHost ( ) : base ( nameof ( IntegrationTest ) , typeof ( MyServices ) . Assembly ) { }
17-
18- public override void Configure ( Container container )
19- {
20- }
2120 }
21+ }
2222
23- public IntegrationTest ( )
24- {
25- appHost = new AppHost ( )
26- . Init ( )
27- . Start ( BaseUri ) ;
28- }
23+ public IntegrationTest ( )
24+ {
25+ appHost = new AppHost ( )
26+ . Init ( )
27+ . Start ( BaseUri ) ;
28+ }
2929
30- [ OneTimeTearDown ]
31- public void OneTimeTearDown ( ) => appHost . Dispose ( ) ;
30+ [ OneTimeTearDown ]
31+ public void OneTimeTearDown ( ) => appHost . Dispose ( ) ;
3232
33- public IServiceClient CreateClient ( ) => new JsonServiceClient ( BaseUri ) ;
33+ public IServiceClient CreateClient ( ) => new JsonServiceClient ( BaseUri ) ;
3434
35- [ Test ]
36- public void Can_call_Hello_Service ( )
37- {
38- var client = CreateClient ( ) ;
35+ [ Test ]
36+ public void Can_call_Hello_Service ( )
37+ {
38+ var client = CreateClient ( ) ;
3939
40- var response = client . Get ( new Hello { Name = "World" } ) ;
40+ var response = client . Get ( new Hello { Name = "World" } ) ;
4141
42- Assert . That ( response . Result , Is . EqualTo ( "Hello, World!" ) ) ;
43- }
42+ Assert . That ( response . Result , Is . EqualTo ( "Hello, World!" ) ) ;
4443 }
4544}
0 commit comments