@@ -39,18 +39,25 @@ public SerilogUiAppRoutesTest()
3939            _sut  =  new  SerilogUiAppRoutes ( _contextAccessor ,  _streamLoaderMock ) ; 
4040        } 
4141
42-         [ Fact ] 
43-         public  async  Task  It_gets_app_home ( ) 
42+         [ Theory ] 
43+         [ InlineData ( null ,  "test" ) ] 
44+         [ InlineData ( "" ,  "test" ) ] 
45+         [ InlineData ( " " ,  "test" ) ] 
46+         [ InlineData ( "sub-path" ,  "sub-path/test" ) ] 
47+         [ InlineData ( "sub-path/" ,  "sub-path/test" ) ] 
48+         [ InlineData ( "/sub-path/" ,  "sub-path/test" ) ] 
49+         public  async  Task  It_gets_app_home ( string ?  serverSubPath ,  string  expectedRoutePrefix ) 
4450        { 
4551            // Arrange 
46-             _sut . SetOptions ( new  UiOptions ( new  ProvidersOptions ( ) ) 
47-             { 
48-                 BodyContent  =  "<div>body-test</div>" , 
49-                 HeadContent  =  "<div>head-test</div>" 
50-             } 
51-                 . WithAuthenticationType ( AuthenticationType . Jwt ) 
52-                 . WithRoutePrefix ( "test" ) 
53-                 . WithHomeUrl ( "home-url" ) 
52+             var  body  =  "<div>body-test</div>" ; 
53+             var  head  =  "<div>head-test</div>" ; 
54+             var  baseOpts  =  new  UiOptions ( new ( ) )  {  BodyContent  =  body ,  HeadContent  =  head  } ; 
55+             _sut 
56+                 . SetOptions ( baseOpts 
57+                     . WithAuthenticationType ( AuthenticationType . Jwt ) 
58+                     . WithRoutePrefix ( "test" ) 
59+                     . WithServerSubPath ( serverSubPath ! ) 
60+                     . WithHomeUrl ( "home-url" ) 
5461            ) ; 
5562            _testContext . Request . Path  =  "/serilog-ui-url/" ; 
5663            _testContext . Response . Body  =  new  MemoryStream ( ) ; 
@@ -75,9 +82,8 @@ public async Task It_gets_app_home()
7582                "<body><div id=\" serilog-ui-app\" ></div>"  + 
7683                "<script>const config = '%7B%22authType%22%3A%22Jwt%22%2C%22columnsInfo%22%3A%7B%7D%2C%22"  + 
7784                "disabledSortOnKeys%22%3A%5B%5D%2C%22renderExceptionAsStringKeys%22%3A%5B%5D%2C%22showBrand%22%3Atrue%2C%22homeUrl%22%3A%22home-url"  + 
78-                 "%22%2C%22blockHomeAccess%22%3Afalse%2C%22routePrefix%22%3A%22"  + 
79-                 "test%22%2C%22expandDropdownsByDefault%22%3Afalse%7D';</script><div>body-test</div></body></html>" 
80-             ) ; 
85+                 "%22%2C%22blockHomeAccess%22%3Afalse%2C%22routePrefix%22%3A%22"  +  Uri . EscapeDataString ( expectedRoutePrefix )  + 
86+                 "%22%2C%22expandDropdownsByDefault%22%3Afalse%7D';</script><div>body-test</div></body></html>" ) ; 
8187        } 
8288
8389        [ Fact ] 
0 commit comments