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

Commit 4447f0d

Browse files
committed
Enable more tests for .NET Core
1 parent 84eb3e3 commit 4447f0d

11 files changed

Lines changed: 2146 additions & 16 deletions

File tree

lib/tests/netstandard1.6/ServiceStack.deps.json

Lines changed: 2091 additions & 0 deletions
Large diffs are not rendered by default.
1.39 MB
Binary file not shown.
420 KB
Binary file not shown.

lib/tests/netstandard1.6/copy.bat

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
SET BUILD=Debug
2+
REM SET BUILD=Release
3+
4+
COPY ..\..\..\ServiceStack\src\ServiceStack\bin\%BUILD%\netstandard1.6\ServiceStack.dll .
5+
COPY ..\..\..\ServiceStack\src\ServiceStack\bin\%BUILD%\netstandard1.6\ServiceStack.pdb .
6+
COPY ..\..\..\ServiceStack\src\ServiceStack\bin\%BUILD%\netstandard1.6\ServiceStack.deps.json .
7+

src/ServiceStack.Redis/RedisClient.ICacheClient.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,12 +54,12 @@ public T Get<T>(string key)
5454

5555
//Looking up Dictionary<Type,bool> for type is faster than HashSet<Type>.
5656
private static Dictionary<Type, bool> integralTypes = new Dictionary<Type, bool> {
57-
{ typeof(byte), true },
57+
{ typeof(byte), true},
5858
{ typeof(sbyte), true},
5959
{ typeof(short), true},
6060
{ typeof(ushort), true},
6161
{ typeof(int), true},
62-
{ typeof(uint), true },
62+
{ typeof(uint), true},
6363
{ typeof(long), true},
6464
{ typeof(ulong), true},
6565
};

src/ServiceStack/project.json

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
{
2+
"configurations": {
3+
"Debug": {
4+
"buildOptions": {
5+
"define": ["DEBUG", "TRACE"]
6+
}
7+
},
8+
"Release": {
9+
"buildOptions": {
10+
"define": ["TRACE"],
11+
"optimize": true
12+
}
13+
}
14+
},
15+
"dependencies": {
16+
"NETStandard.Library": "1.6.0"
17+
},
18+
"frameworks": {
19+
"netstandard1.6": {
20+
"bin" : {
21+
"assembly":"../../lib/tests/netstandard1.6/ServiceStack.dll",
22+
"pdb" : "../../lib/tests/netstandard1.6/ServiceStack.pdb"
23+
}
24+
}
25+
},
26+
"version": "1.0.0"
27+
}

tests/ServiceStack.Redis.Tests/NetCoreTestsRunner.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ public static int Main(string[] args)
2626
Licensing.RegisterLicense(licenseKey);
2727
//"ActivatedLicenseFeatures: ".Print(LicenseUtils.ActivatedLicenseFeatures());
2828

29-
CultureInfo.DefaultThreadCurrentCulture = new CultureInfo("en-US");
29+
CultureInfo.DefaultThreadCurrentCulture = new CultureInfo("en-US");
3030
JsConfig.InitStatics();
3131
//JsonServiceClient client = new JsonServiceClient();
3232
var writer = new ExtendedTextWrapper(Console.Out);

tests/ServiceStack.Redis.Tests/RedisBenchmarkTests.cs

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
1-
#if !NETCORE_SUPPORT
2-
using System;
1+
using System;
32
using System.Diagnostics;
43
using NUnit.Framework;
54
using ServiceStack.Logging;
@@ -161,6 +160,7 @@ public void Benchmark_SET_raw_bytes_8MB_ServiceStack()
161160
(i, bytes) => redis.Set("eitan" + i.ToString(), bytes));
162161
}
163162

163+
#if !NETCORE
164164
[Test]
165165
public void Benchmark_SET_raw_bytes_8MB_Sider()
166166
{
@@ -170,6 +170,7 @@ public void Benchmark_SET_raw_bytes_8MB_Sider()
170170
Run("Sider 8MB", 8000000,
171171
(i, bytes) => redis.SetRaw("eitan" + i.ToString(), bytes));
172172
}
173+
#endif
173174

174175
[Test]
175176
public void Benchmark_SET_raw_bytes_1MB_ServiceStack()
@@ -180,6 +181,7 @@ public void Benchmark_SET_raw_bytes_1MB_ServiceStack()
180181
(i, bytes) => redis.Set("eitan" + i.ToString(), bytes));
181182
}
182183

184+
#if !NETCORE
183185
[Test]
184186
public void Benchmark_SET_raw_bytes_1MB_Sider()
185187
{
@@ -189,6 +191,7 @@ public void Benchmark_SET_raw_bytes_1MB_Sider()
189191
Run("Sider 1MB", 1000000,
190192
(i, bytes) => redis.SetRaw("eitan" + i.ToString(), bytes));
191193
}
194+
#endif
192195

193196
[Test]
194197
public void Benchmark_SET_raw_bytes_100k_ServiceStack()
@@ -199,6 +202,7 @@ public void Benchmark_SET_raw_bytes_100k_ServiceStack()
199202
(i, bytes) => redis.Set("eitan" + i.ToString(), bytes));
200203
}
201204

205+
#if !NETCORE
202206
[Test]
203207
public void Benchmark_SET_raw_bytes_100k_Sider()
204208
{
@@ -208,6 +212,7 @@ public void Benchmark_SET_raw_bytes_100k_Sider()
208212
Run("Sider 100K", 100000,
209213
(i, bytes) => redis.SetRaw("eitan" + i.ToString(), bytes));
210214
}
215+
#endif
211216

212217
[Test]
213218
public void Benchmark_SET_raw_bytes_10k_ServiceStack()
@@ -218,6 +223,7 @@ public void Benchmark_SET_raw_bytes_10k_ServiceStack()
218223
(i, bytes) => redis.Set("eitan" + i.ToString(), bytes));
219224
}
220225

226+
#if !NETCORE
221227
[Test]
222228
public void Benchmark_SET_raw_bytes_10k_Sider()
223229
{
@@ -227,6 +233,7 @@ public void Benchmark_SET_raw_bytes_10k_Sider()
227233
Run("Sider 10K", 10000,
228234
(i, bytes) => redis.SetRaw("eitan" + i.ToString(), bytes));
229235
}
236+
#endif
230237

231238
[Test]
232239
public void Benchmark_SET_raw_bytes_1k_ServiceStack()
@@ -237,6 +244,7 @@ public void Benchmark_SET_raw_bytes_1k_ServiceStack()
237244
(i, bytes) => redis.Set("eitan" + i.ToString(), bytes));
238245
}
239246

247+
#if !NETCORE
240248
[Test]
241249
public void Benchmark_SET_raw_bytes_1k_Sider()
242250
{
@@ -246,7 +254,7 @@ public void Benchmark_SET_raw_bytes_1k_Sider()
246254
Run("Sider 1K", 1000,
247255
(i, bytes) => redis.SetRaw("eitan" + i.ToString(), bytes));
248256
}
257+
#endif
249258
}
250259

251-
}
252-
#endif
260+
}

tests/ServiceStack.Redis.Tests/RedisCacheClientTests.cs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,6 @@ public void Can_Set_and_Get_key_with_all_byte_values()
7272
Assert.That(resultValue, Is.EquivalentTo(value));
7373
}
7474

75-
#if !NETCORE_SUPPORT
7675
[Test]
7776
public void Can_Replace_By_Pattern()
7877
{
@@ -103,7 +102,6 @@ public void Can_Replace_By_Pattern()
103102
result2 = cacheClient.Get<string>("string1");
104103
Assert.That(result2, Is.Null);
105104
}
106-
#endif
107105

108106
[Test]
109107
public void Can_GetTimeToLive()

tests/ServiceStack.Redis.Tests/SslTests.cs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,13 +26,11 @@ public class SslTests
2626
[TestFixtureSetUp]
2727
public void TestFixtureSetUp()
2828
{
29-
#if !NETCORE_SUPPORT
3029
var settings = new TextFileSettings("~/azureconfig.txt".MapProjectPath());
3130
Host = settings.GetString("Host");
3231
Port = settings.Get("Port", 6379);
3332
Password = settings.GetString("Password");
3433
connectionString = "{0}@{1}".Fmt(Password, Host);
35-
#endif
3634
}
3735

3836
[Test]

0 commit comments

Comments
 (0)