Skip to content

Commit

Permalink
fixing mono build. Mocking HttpContext.Current doesn't work on Mono f…
Browse files Browse the repository at this point in the history
  • Loading branch information
MichaCo committed Dec 26, 2015
1 parent 1c91620 commit f4c8bd9
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 6 deletions.
Expand Up @@ -21,7 +21,7 @@
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\Debug\</OutputPath>
<DefineConstants>TRACE;DEBUG;NET40;REDISENABLED</DefineConstants>
<DefineConstants>TRACE;DEBUG;NET40;REDISENABLED;MOCK_HTTPCONTEXTE_ENABLED</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<Prefer32Bit>false</Prefer32Bit>
Expand Down
Expand Up @@ -21,7 +21,7 @@
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\Debug\</OutputPath>
<DefineConstants>TRACE;DEBUG;CODE_ANALYSIS;NET45;REDISENABLED</DefineConstants>
<DefineConstants>TRACE;DEBUG;CODE_ANALYSIS;CODE_ANALYSIS;NET45;REDISENABLED;MOCK_HTTPCONTEXTE_ENABLED</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<CodeAnalysisRuleSet>..\..\common\CacheManager.Test.ruleset</CodeAnalysisRuleSet>
Expand Down
4 changes: 2 additions & 2 deletions test/CacheManager.Tests/BaseCacheManagerTest.cs
Expand Up @@ -100,7 +100,7 @@ public static ICacheManager<object> WithTwoNamedMemoryCaches
.EnableStatistics();
});

#if !NET40
#if !NET40 && MOCK_HTTPCONTEXTE_ENABLED
public static ICacheManager<object> WithSystemWebCache
=> CacheFactory.Build(
settings =>
Expand Down Expand Up @@ -291,7 +291,7 @@ public static IEnumerable<object[]> TestCacheManagers
#endif
//// yield return new object[] { TestManagers.WithMemcached };
//// yield return new object[] { TestManagers.WithCouchbaseMemcached };
#if !NET40
#if !NET40 && MOCK_HTTPCONTEXTE_ENABLED
yield return new object[] { TestManagers.WithSystemWebCache };
#endif
}
Expand Down
4 changes: 3 additions & 1 deletion test/CacheManager.Tests/SystemWebCacheHandleWrapper.cs
@@ -1,4 +1,6 @@
#if !NET40
// disabling for NET40, our Web implementation is not available on that framework
// disabling it for builds on Mono because setting the HttpContext.Current causes all kinds of strange exceptions
#if !NET40 && MOCK_HTTPCONTEXTE_ENABLED
using System.IO;
using System.Web;
using CacheManager.Core;
Expand Down
2 changes: 1 addition & 1 deletion test/CacheManager.Tests/project.json
Expand Up @@ -17,7 +17,7 @@
},
"compilationOptions": {
"define": [
"REDISENABLED"
"REDISENABLED", "MOCK_HTTPCONTEXTE_ENABLED"
]
}
}
Expand Down

0 comments on commit f4c8bd9

Please sign in to comment.