This repository was archived by the owner on Dec 24, 2022. It is now read-only.
File tree Expand file tree Collapse file tree 1 file changed +18
-10
lines changed
tests/ServiceStack.Text.Tests Expand file tree Collapse file tree 1 file changed +18
-10
lines changed Original file line number Diff line number Diff line change @@ -20,11 +20,7 @@ public void SetUp()
20
20
[ TearDown ]
21
21
public void TearDown ( )
22
22
{
23
- #if NETCORE
24
- Licensing . RegisterLicense ( System . Environment . GetEnvironmentVariable ( "SERVICESTACK_LICENSE" ) ) ;
25
- #else
26
- Licensing . RegisterLicense ( new AppSettings ( ) . GetString ( "servicestack:license" ) ) ;
27
- #endif
23
+ LicenseHelper . RegisterLicense ( ) ;
28
24
}
29
25
30
26
[ Test ]
@@ -87,11 +83,7 @@ public class RegisteredLicenseUsageTests : LicenseUsageTests
87
83
[ Test ]
88
84
public void Allows_serialization_of_21_types ( )
89
85
{
90
- #if NETCORE
91
- Licensing . RegisterLicense ( System . Environment . GetEnvironmentVariable ( "SERVICESTACK_LICENSE" ) ) ;
92
- #else
93
- Licensing . RegisterLicense ( new AppSettings ( ) . GetString ( "servicestack:license" ) ) ;
94
- #endif
86
+ LicenseHelper . RegisterLicense ( ) ;
95
87
96
88
Serialize20 ( ) ;
97
89
Serialize20 ( ) ;
@@ -102,6 +94,22 @@ public void Allows_serialization_of_21_types()
102
94
"{\" Id\" :1}" . FromJson < T21 > ( ) ;
103
95
}
104
96
}
97
+
98
+ public static class LicenseHelper
99
+ {
100
+ public static void RegisterLicense ( )
101
+ {
102
+ var envKey = System . Environment . GetEnvironmentVariable ( "SERVICESTACK_LICENSE" ) ;
103
+ if ( envKey != null )
104
+ {
105
+ Licensing . RegisterLicense ( envKey ) ;
106
+ }
107
+
108
+ #if ! NETCORE
109
+ Licensing . RegisterLicense ( new AppSettings ( ) . GetString ( "servicestack:license" ) ) ;
110
+ #endif
111
+ }
112
+ }
105
113
106
114
class T01 { public int Id { get ; set ; } }
107
115
class T02 { public int Id { get ; set ; } }
You can’t perform that action at this time.
0 commit comments