This repository was archived by the owner on Dec 24, 2022. It is now read-only.
File tree Expand file tree Collapse file tree
tests/ServiceStack.Redis.Tests Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -264,15 +264,23 @@ public void Can_IncrementItemInSortedSet()
264264 public void Can_WorkInSortedSetUnderDifferentCulture ( )
265265 {
266266#if NETCORE
267+ var prevCulture = CultureInfo . CurrentCulture ;
267268 CultureInfo . CurrentCulture = new CultureInfo ( "ru-RU" ) ;
268269#else
270+ var prevCulture = Thread . CurrentThread . CurrentCulture ;
269271 Thread . CurrentThread . CurrentCulture = CultureInfo . CreateSpecificCulture ( "ru-RU" ) ;
270272#endif
271273 Redis . AddItemToSortedSet ( SetId , "key" , 123.22 ) ;
272274
273275 var map = Redis . GetAllWithScoresFromSortedSet ( SetId ) ;
274276
275277 Assert . AreEqual ( 123.22 , map [ "key" ] ) ;
278+
279+ #if NETCORE
280+ CultureInfo . CurrentCulture = prevCulture ;
281+ #else
282+ Thread . CurrentThread . CurrentCulture = prevCulture ;
283+ #endif
276284 }
277285
278286
Original file line number Diff line number Diff line change 44namespace ServiceStack . Redis . Tests
55{
66 [ TestFixture ]
7+ #if ! NETCORE
78 [ Explicit , Ignore ( "CI requires redis-server v3.2.0" ) ]
9+ #endif
810 public class RedisGeoNativeClientTests
911 {
1012 private readonly RedisNativeClient redis ;
1113
1214 public RedisGeoNativeClientTests ( )
1315 {
14- redis = new RedisNativeClient ( "10.0.0.121" ) ;
16+ redis = new RedisNativeClient ( TestConfig . GeoHost ) ;
1517 }
1618
1719 [ TestFixtureTearDown ]
Original file line number Diff line number Diff line change 44namespace ServiceStack . Redis . Tests
55{
66 [ TestFixture ]
7+ #if ! NETCORE
78 [ Explicit , Ignore ( "CI requires redis-server v3.2.0" ) ]
9+ #endif
810 public class RedisGeoTests
911 {
1012 private readonly RedisClient redis ;
1113
1214 public RedisGeoTests ( )
1315 {
14- redis = new RedisClient ( "10.0.0.121" ) ;
16+ redis = new RedisClient ( TestConfig . GeoHost ) ;
1517 }
1618
1719 [ TestFixtureTearDown ]
Original file line number Diff line number Diff line change @@ -13,10 +13,10 @@ static TestConfig()
1313
1414 public const bool IgnoreLongTests = true ;
1515
16- public static string SingleHost
17- {
18- get { return Environment . GetEnvironmentVariable ( "CI_REDIS" ) ?? "localhost" ; }
19- }
16+ public static string SingleHost => Environment . GetEnvironmentVariable ( "CI_REDIS" ) ?? "localhost" ;
17+
18+ public static string GeoHost => Environment . GetEnvironmentVariable ( "CI_REDIS" ) ?? "10.0.0.121" ;
19+
2020 public static readonly string [ ] MasterHosts = new [ ] { "localhost" } ;
2121 public static readonly string [ ] SlaveHosts = new [ ] { "localhost" } ;
2222
You can’t perform that action at this time.
0 commit comments