updated test proj

This commit is contained in:
Shannon
2014-09-16 11:51:10 +10:00
parent 311639332d
commit 1d4e80904e
3 changed files with 22 additions and 17 deletions

View File

@@ -0,0 +1,21 @@
using NUnit.Framework;
using umbraco.presentation.webservices;
namespace Umbraco.Tests.Cache
{
[TestFixture]
public class CacheRefresherTests
{
[TestCase("", "123456", "testmachine", true)] //empty hash will continue
[TestCase("2c8aabac795d189d444a9cdc6e2a1819", "123456", "testmachine", false)] //match, don't continue
[TestCase("2c8aabac795d189d444a9cdc6e2a1819", "12345", "testmachine", true)]
[TestCase("2c8aabac795d189d444a9cdc6e2a1819", "123456", "testmachin", true)]
[TestCase("2c8aabac795d189d444a9cdc6e2a181", "123456", "testmachine", true)]
public void Continue_Refreshing_For_Request(string hash, string appDomainAppId, string machineName, bool expected)
{
var refresher = new CacheRefresher();
Assert.AreEqual(expected, refresher.ContinueRefreshingForRequest(hash, appDomainAppId, machineName));
}
}
}

View File

@@ -1,26 +1,9 @@
using NUnit.Framework;
using Umbraco.Core.Cache;
using umbraco.presentation.webservices;
using Umbraco.Tests.TestHelpers;
namespace Umbraco.Tests.Cache
{
[TestFixture]
public class CacheRefresherTests
{
[TestCase("", "123456", "testmachine", true)] //empty hash will continue
[TestCase("2c8aabac795d189d444a9cdc6e2a1819", "123456", "testmachine", false)] //match, don't continue
[TestCase("2c8aabac795d189d444a9cdc6e2a1819", "12345", "testmachine", true)]
[TestCase("2c8aabac795d189d444a9cdc6e2a1819", "123456", "testmachin", true)]
[TestCase("2c8aabac795d189d444a9cdc6e2a181", "123456", "testmachine", true)]
public void Continue_Refreshing_For_Request(string hash, string appDomainAppId, string machineName, bool expected)
{
var refresher = new CacheRefresher();
Assert.AreEqual(expected, refresher.ContinueRefreshingForRequest(hash, appDomainAppId, machineName));
}
}
[TestFixture]
public class HttpRequestCacheProviderTests : CacheProviderTests
{

View File

@@ -167,6 +167,7 @@
<Compile Include="AngularIntegration\JsInitializationTests.cs" />
<Compile Include="AngularIntegration\ServerVariablesParserTests.cs" />
<Compile Include="AttemptTests.cs" />
<Compile Include="Cache\CacheRefresherTests.cs" />
<Compile Include="Membership\DynamicMemberContentTests.cs" />
<Compile Include="Membership\MembershipProviderBaseTests.cs" />
<Compile Include="Membership\UmbracoServiceMembershipProviderTests.cs" />