1111
1212namespace  SIL . XForge . Scripture ; 
1313
14- /// <summary> 
15- /// Represents what environment the application is running in. 
16- /// </summary> 
17- public  enum  RunMode 
18- { 
19-     Development , 
20-     Production , 
21- } 
22- 
2314[ TestFixture ] 
2415public  class  StartupTests 
2516{ 
@@ -177,10 +168,15 @@ private static void IsSpaRoute_Helper(string path, RunMode[] runModes, bool expe
177168    [ TestCase ( "/connect-project" ) ] 
178169    [ TestCase ( "/serval-administration" ) ] 
179170    [ TestCase ( "/system-administration" ) ] 
171+     // Handling '//login' may not be very important but would make sense to handle it as if it was normalized to 
172+     // '/login'. 
173+     [ TestCase ( "//login" ) ] 
174+     [ TestCase ( "//login//" ) ] 
175+     [ TestCase ( "///login" ) ] 
180176    public  void  IsSpaRoute_ProductionAndDevelopment_True ( string  path ) 
181177    { 
182178        RunMode [ ]  runModes  =  [ RunMode . Production ,  RunMode . Development ] ; 
183-         bool  expected  =  true ; 
179+         const   bool  expected  =  true ; 
184180        IsSpaRoute_Helper ( path ,  runModes ,  expected ) ; 
185181    } 
186182
@@ -195,7 +191,7 @@ public void IsSpaRoute_ProductionAndDevelopment_True(string path)
195191    public  void  IsSpaRoute_Development_True ( string  path ) 
196192    { 
197193        RunMode [ ]  runModes  =  [ RunMode . Development ] ; 
198-         bool  expected  =  true ; 
194+         const   bool  expected  =  true ; 
199195        IsSpaRoute_Helper ( path ,  runModes ,  expected ) ; 
200196    } 
201197
@@ -221,7 +217,9 @@ public void IsSpaRoute_Development_True(string path)
221217    [ TestCase ( "/??/login" ) ] 
222218    [ TestCase ( "/#login" ) ] 
223219    [ TestCase ( "/#/login" ) ] 
224-     // It may or may not be possible for the path to be the empty string. If it is, let's have ASP.NET handle it. 
220+     // It may or may not be possible in practice for the path to be null or empty. If it is, let's have ASP.NET handle 
221+     // it. 
222+     [ TestCase ( null ) ] 
225223    [ TestCase ( "" ) ] 
226224    // The paths "/", "/Index", and "/Status/Error" are handled by ASP.NET and don't even get to IsSpaRoute. If they did 
227225    // for some reason, we'll have IsSpaRoute return false. 
@@ -235,7 +233,7 @@ public void IsSpaRoute_Development_True(string path)
235233    public  void  IsSpaRoute_ProductionAndDevelopment_False ( string  path ) 
236234    { 
237235        RunMode [ ]  runModes  =  [ RunMode . Production ,  RunMode . Development ] ; 
238-         bool  expected  =  false ; 
236+         const   bool  expected  =  false ; 
239237        IsSpaRoute_Helper ( path ,  runModes ,  expected ) ; 
240238    } 
241239
@@ -244,10 +242,19 @@ public void IsSpaRoute_ProductionAndDevelopment_False(string path)
244242    public  void  IsSpaRoute_Development_False ( string  path ) 
245243    { 
246244        RunMode [ ]  runModes  =  [ RunMode . Development ] ; 
247-         bool  expected  =  false ; 
245+         const   bool  expected  =  false ; 
248246        IsSpaRoute_Helper ( path ,  runModes ,  expected ) ; 
249247    } 
250248
249+     /// <summary> 
250+     /// Represents what environment the application is running in. 
251+     /// </summary> 
252+     private  enum  RunMode 
253+     { 
254+         Development , 
255+         Production , 
256+     } 
257+ 
251258    private  class  TestEnvironment 
252259    { 
253260        public  TestEnvironment ( string ?  environmentName  =  null ) 
0 commit comments