Files
Umbraco-CMS/src/Umbraco.Tests/Cache/HttpRequestAppCacheTests.cs
T

53 lines
1.2 KiB
C#
Raw Normal View History

2018-06-29 19:52:40 +02:00
using NUnit.Framework;
using Umbraco.Core.Cache;
using Umbraco.Tests.TestHelpers;
namespace Umbraco.Tests.Cache
{
[TestFixture]
2019-01-18 08:14:08 +01:00
public class HttpRequestAppCacheTests : AppCacheTests
2018-06-29 19:52:40 +02:00
{
2019-01-18 08:29:16 +01:00
private HttpRequestAppCache _appCache;
2018-06-29 19:52:40 +02:00
private FakeHttpContextFactory _ctx;
public override void Setup()
{
base.Setup();
_ctx = new FakeHttpContextFactory("http://localhost/test");
2019-01-18 08:29:16 +01:00
_appCache = new HttpRequestAppCache(_ctx.HttpContext);
2018-06-29 19:52:40 +02:00
}
2019-01-18 08:14:08 +01:00
internal override IAppCache AppCache
2018-06-29 19:52:40 +02:00
{
2019-01-18 08:29:16 +01:00
get { return _appCache; }
2018-06-29 19:52:40 +02:00
}
protected override int GetTotalItemCount
{
get { return _ctx.HttpContext.Items.Count; }
}
}
[TestFixture]
2019-01-18 08:29:16 +01:00
public class DictionaryAppCacheTests : AppCacheTests
2018-06-29 19:52:40 +02:00
{
2019-01-18 08:29:16 +01:00
private DictionaryAppCache _appCache;
2018-06-29 19:52:40 +02:00
public override void Setup()
{
base.Setup();
2019-01-18 08:29:16 +01:00
_appCache = new DictionaryAppCache();
2018-06-29 19:52:40 +02:00
}
2019-01-18 08:14:08 +01:00
internal override IAppCache AppCache
2018-06-29 19:52:40 +02:00
{
2019-01-18 08:29:16 +01:00
get { return _appCache; }
2018-06-29 19:52:40 +02:00
}
protected override int GetTotalItemCount
{
2019-01-18 08:29:16 +01:00
get { return _appCache.Items.Count; }
2018-06-29 19:52:40 +02:00
}
}
}