File tree Expand file tree Collapse file tree 1 file changed +7
-3
lines changed
CoreMemoryCache/NHibernate.Caches.CoreMemoryCache.Tests Expand file tree Collapse file tree 1 file changed +7
-3
lines changed Original file line number Diff line number Diff line change 1
- using System ;
1
+ #if ! NETFX
2
2
using NUnit . Framework ;
3
3
using System . Configuration ;
4
4
using System . IO ;
@@ -13,9 +13,11 @@ namespace NHibernate.Caches.CoreMemoryCache.Tests
13
13
[ SetUpFixture ]
14
14
public class TestsContext
15
15
{
16
- private static bool ExecutingWithVsTest { get ; } =
16
+ private static readonly bool ExecutingWithVsTest =
17
17
Assembly . GetEntryAssembly ( ) ? . GetName ( ) . Name == "testhost" ;
18
18
19
+ private static bool _removeTesthostConfig ;
20
+
19
21
[ OneTimeSetUp ]
20
22
public void RunBeforeAnyTests ( )
21
23
{
@@ -35,7 +37,7 @@ public void RunAfterAnyTests()
35
37
{
36
38
//When .NET Core App 2.0 tests run from VS/VSTest the entry assembly is "testhost.dll"
37
39
//so we need to explicitly load the configuration
38
- if ( ExecutingWithVsTest )
40
+ if ( _removeTesthostConfig )
39
41
{
40
42
File . Delete ( GetTesthostConfigPath ( ) ) ;
41
43
}
@@ -52,6 +54,7 @@ private static void ReadCoreCacheSectionFromTesthostConfig()
52
54
// or a previous test run was interupted before its cleanup (RunAfterAnyTests): go clean it manually.
53
55
// Discussion about this mess: https://github.com/dotnet/corefx/issues/22101
54
56
File . Copy ( configPath , GetTesthostConfigPath ( ) ) ;
57
+ _removeTesthostConfig = true ;
55
58
ConfigurationManager . RefreshSection ( "corememorycache" ) ;
56
59
}
57
60
@@ -83,3 +86,4 @@ private static void ConfigureLog4Net()
83
86
}
84
87
}
85
88
}
89
+ #endif
You can’t perform that action at this time.
0 commit comments