@@ -1205,27 +1205,19 @@ public void CanPersistPrerenderedState_WebAssemblyPrerenderedStateAvailableOnlyO
12051205 [ Fact ]
12061206 public void CanPersistCultureFromServer ( )
12071207 {
1208- Environment . SetEnvironmentVariable ( "ASPNETCORE_EnforceServerCultureOnClient" , "true" ) ;
1209-
1210- try
1211- {
1212- Navigate ( $ "{ ServerPathBase } /Culture/SetCulture?culture=fr-FR&redirectUri={ Uri . EscapeDataString ( $ "{ ServerPathBase } /persist-culture-state") } ") ;
1213- Browser . Exists ( By . ClassName ( "return-from-culture-setter" ) ) . Click ( ) ;
1208+ _serverFixture . AdditionalArguments . Add ( "EnforceServerCultureOnClient=true" ) ;
1209+
1210+ Navigate ( $ "{ ServerPathBase } /Culture/SetCulture?culture=fr-FR&redirectUri={ Uri . EscapeDataString ( $ "{ ServerPathBase } /persist-culture-state") } ") ;
1211+ Browser . Exists ( By . ClassName ( "return-from-culture-setter" ) ) . Click ( ) ;
12141212
1215- Browser . Equal ( "Prerender" , ( ) => Browser . FindElement ( By . Id ( "prerender" ) ) . Text ) ;
1216- Browser . Equal ( "fr-FR" , ( ) => Browser . FindElement ( By . Id ( "culture-set" ) ) . Text ) ;
1217- Browser . Equal ( "fr-FR" , ( ) => Browser . FindElement ( By . Id ( "culture-ui-set" ) ) . Text ) ;
1213+ Browser . Equal ( "Prerender" , ( ) => Browser . FindElement ( By . Id ( "prerender" ) ) . Text ) ;
1214+ Browser . Equal ( "fr-FR" , ( ) => Browser . FindElement ( By . Id ( "culture-set" ) ) . Text ) ;
1215+ Browser . Equal ( "fr-FR" , ( ) => Browser . FindElement ( By . Id ( "culture-ui-set" ) ) . Text ) ;
12181216
1219- Browser . Exists ( By . Id ( "start-blazor" ) ) . Click ( ) ;
1217+ Browser . Exists ( By . Id ( "start-blazor" ) ) . Click ( ) ;
12201218
1221- Browser . Equal ( "Interactive" , ( ) => Browser . FindElement ( By . Id ( "interactive" ) ) . Text ) ;
1222- Browser . Equal ( "fr-FR" , ( ) => Browser . FindElement ( By . Id ( "culture-set" ) ) . Text ) ;
1223- Browser . Equal ( "fr-FR" , ( ) => Browser . FindElement ( By . Id ( "culture-ui-set" ) ) . Text ) ;
1224- }
1225- finally
1226- {
1227- Environment . SetEnvironmentVariable ( "ASPNETCORE_EnforceServerCultureOnClient" , null ) ;
1228- }
1219+ Browser . Equal ( "Interactive" , ( ) => Browser . FindElement ( By . Id ( "interactive" ) ) . Text ) ;
1220+ Browser . Equal ( "fr-FR" , ( ) => Browser . FindElement ( By . Id ( "culture-set" ) ) . Text ) ;
12291221 }
12301222
12311223 [ Fact ]
0 commit comments