Skip to content
This repository was archived by the owner on Dec 24, 2022. It is now read-only.

Commit 1ade178

Browse files
committed
Add redis geo tests to .NET Core CI
1 parent 4447f0d commit 1ade178

4 files changed

Lines changed: 18 additions & 6 deletions

File tree

tests/ServiceStack.Redis.Tests/RedisClientSortedSetTests.cs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff 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

tests/ServiceStack.Redis.Tests/RedisGeoNativeClientTests.cs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,16 @@
44
namespace 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]

tests/ServiceStack.Redis.Tests/RedisGeoTests.cs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,16 @@
44
namespace 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]

tests/ServiceStack.Redis.Tests/TestConfig.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff 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

0 commit comments

Comments
 (0)