Worked on the application cache, added request cache, changed some stuff over to be interfaces, added unit tests suite (need mroe) to test all caching providers.

Conflicts:
	src/Umbraco.Core/Cache/CacheProviderBase.cs
	src/Umbraco.Core/Cache/HttpRuntimeCacheProvider.cs
	src/Umbraco.Core/Cache/NullCacheProvider.cs
	src/Umbraco.Core/Cache/StaticCacheProvider.cs
This commit is contained in:
Shannon
2013-12-16 12:51:02 +11:00
parent 9105c08a4c
commit f11d4fbedd
21 changed files with 1012 additions and 344 deletions

View File

@@ -0,0 +1,52 @@
using NUnit.Framework;
using Umbraco.Core.Cache;
using Umbraco.Tests.TestHelpers;
namespace Umbraco.Tests.Cache
{
[TestFixture]
public class HttpRequestCacheProviderTests : CacheProviderTests
{
private HttpRequestCacheProvider _provider;
private FakeHttpContextFactory _ctx;
public override void Setup()
{
base.Setup();
_ctx = new FakeHttpContextFactory("http://localhost/test");
_provider = new HttpRequestCacheProvider(() => _ctx.HttpContext);
}
internal override ICacheProvider Provider
{
get { return _provider; }
}
protected override int GetTotalItemCount
{
get { return _ctx.HttpContext.Items.Count; }
}
}
[TestFixture]
public class StaticCacheProviderTests : CacheProviderTests
{
private StaticCacheProvider _provider;
public override void Setup()
{
base.Setup();
_provider = new StaticCacheProvider();
}
internal override ICacheProvider Provider
{
get { return _provider; }
}
protected override int GetTotalItemCount
{
get { return _provider.StaticCache.Count; }
}
}
}