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

Commit 0cd4970

Browse files
committed
Fix LicenseUsage tests on .NET Core
1 parent e445f87 commit 0cd4970

File tree

1 file changed

+12
-6
lines changed

1 file changed

+12
-6
lines changed

tests/ServiceStack.Text.Tests/LicenseUsageTests.cs

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
1-
#if !NETCORE_SUPPORT
2-
// Copyright (c) Service Stack LLC. All Rights Reserved.
1+
// Copyright (c) Service Stack LLC. All Rights Reserved.
32
// License: https://raw.github.com/ServiceStack/ServiceStack/master/license.txt
43

54

@@ -21,7 +20,11 @@ public void SetUp()
2120
[TearDown]
2221
public void TearDown()
2322
{
23+
#if NETCORE
24+
Licensing.RegisterLicense(System.Environment.GetEnvironmentVariable("SERVICESTACK_LICENSE"));
25+
#else
2426
Licensing.RegisterLicense(new AppSettings().GetString("servicestack:license"));
27+
#endif
2528
}
2629

2730
[Test]
@@ -47,7 +50,7 @@ public void Allows_mixed_serialization_of_20_types()
4750
DeserializeBottom10();
4851
}
4952

50-
[Ignore, Test]
53+
[Ignore(""), Test]
5154
public void Throws_on_serialization_of_21_types()
5255
{
5356
Serialize20();
@@ -56,7 +59,7 @@ public void Throws_on_serialization_of_21_types()
5659
Assert.Throws<LicenseException>(() => new T21().ToJson());
5760
}
5861

59-
[Ignore,Test]
62+
[Ignore(""),Test]
6063
public void Throws_on_deserialization_of_21_types()
6164
{
6265
Deserialize20();
@@ -66,7 +69,7 @@ public void Throws_on_deserialization_of_21_types()
6669
"{\"Id\":1}".FromJson<T21>());
6770
}
6871

69-
[Ignore, Test]
72+
[Ignore(""), Test]
7073
public void Throws_on_mixed_serialization_of_21_types()
7174
{
7275
SerializeTop10();
@@ -84,7 +87,11 @@ public class RegisteredLicenseUsageTests : LicenseUsageTests
8487
[Test]
8588
public void Allows_serialization_of_21_types()
8689
{
90+
#if NETCORE
91+
Licensing.RegisterLicense(System.Environment.GetEnvironmentVariable("SERVICESTACK_LICENSE"));
92+
#else
8793
Licensing.RegisterLicense(new AppSettings().GetString("servicestack:license"));
94+
#endif
8895

8996
Serialize20();
9097
Serialize20();
@@ -189,4 +196,3 @@ protected static void DeserializeTop10()
189196
}
190197
}
191198
}
192-
#endif

0 commit comments

Comments
 (0)