Great AppCaches renaming

This commit is contained in:
Stephan
2019-01-17 11:01:23 +01:00
parent 67e4703821
commit 0bee01e0ee
108 changed files with 1538 additions and 1440 deletions

View File

@@ -37,8 +37,8 @@ namespace Umbraco.Tests.Cache
};
var isCached = false;
var cache = new Mock<IRuntimeCacheProvider>();
cache.Setup(x => x.InsertCacheItem(It.IsAny<string>(), It.IsAny<Func<object>>(), It.IsAny<TimeSpan?>(), It.IsAny<bool>(),
var cache = new Mock<IAppPolicedCache>();
cache.Setup(x => x.Insert(It.IsAny<string>(), It.IsAny<Func<object>>(), It.IsAny<TimeSpan?>(), It.IsAny<bool>(),
It.IsAny<CacheItemPriority>(), It.IsAny<CacheItemRemovedCallback>(), It.IsAny<string[]>()))
.Callback(() =>
{
@@ -60,8 +60,8 @@ namespace Umbraco.Tests.Cache
new AuditItem(2, AuditType.Copy, 123, "test", "blah2")
};
var cache = new Mock<IRuntimeCacheProvider>();
cache.Setup(x => x.GetCacheItem(It.IsAny<string>())).Returns(new AuditItem(1, AuditType.Copy, 123, "test", "blah"));
var cache = new Mock<IAppPolicedCache>();
cache.Setup(x => x.Get(It.IsAny<string>())).Returns(new AuditItem(1, AuditType.Copy, 123, "test", "blah"));
var defaultPolicy = new FullDataSetRepositoryCachePolicy<AuditItem, object>(cache.Object, DefaultAccessor, item => item.Id, false);
@@ -78,8 +78,8 @@ namespace Umbraco.Tests.Cache
IList list = null;
var cache = new Mock<IRuntimeCacheProvider>();
cache.Setup(x => x.InsertCacheItem(It.IsAny<string>(), It.IsAny<Func<object>>(), It.IsAny<TimeSpan?>(), It.IsAny<bool>(),
var cache = new Mock<IAppPolicedCache>();
cache.Setup(x => x.Insert(It.IsAny<string>(), It.IsAny<Func<object>>(), It.IsAny<TimeSpan?>(), It.IsAny<bool>(),
It.IsAny<CacheItemPriority>(), It.IsAny<CacheItemRemovedCallback>(), It.IsAny<string[]>()))
.Callback((string cacheKey, Func<object> o, TimeSpan? t, bool b, CacheItemPriority cip, CacheItemRemovedCallback circ, string[] s) =>
{
@@ -87,7 +87,7 @@ namespace Umbraco.Tests.Cache
list = o() as IList;
});
cache.Setup(x => x.GetCacheItem(It.IsAny<string>())).Returns(() =>
cache.Setup(x => x.Get(It.IsAny<string>())).Returns(() =>
{
//return null if this is the first pass
return cached.Any() ? new DeepCloneableList<AuditItem>(ListCloneBehavior.CloneOnce) : null;
@@ -121,8 +121,8 @@ namespace Umbraco.Tests.Cache
var cached = new List<string>();
IList list = null;
var cache = new Mock<IRuntimeCacheProvider>();
cache.Setup(x => x.InsertCacheItem(It.IsAny<string>(), It.IsAny<Func<object>>(), It.IsAny<TimeSpan?>(), It.IsAny<bool>(),
var cache = new Mock<IAppPolicedCache>();
cache.Setup(x => x.Insert(It.IsAny<string>(), It.IsAny<Func<object>>(), It.IsAny<TimeSpan?>(), It.IsAny<bool>(),
It.IsAny<CacheItemPriority>(), It.IsAny<CacheItemRemovedCallback>(), It.IsAny<string[]>()))
.Callback((string cacheKey, Func<object> o, TimeSpan? t, bool b, CacheItemPriority cip, CacheItemRemovedCallback circ, string[] s) =>
{
@@ -130,7 +130,7 @@ namespace Umbraco.Tests.Cache
list = o() as IList;
});
cache.Setup(x => x.GetCacheItem(It.IsAny<string>())).Returns(new AuditItem[] { });
cache.Setup(x => x.Get(It.IsAny<string>())).Returns(new AuditItem[] { });
var defaultPolicy = new FullDataSetRepositoryCachePolicy<AuditItem, object>(cache.Object, DefaultAccessor, item => item.Id, false);
@@ -145,9 +145,9 @@ namespace Umbraco.Tests.Cache
{
var getAll = new[] { (AuditItem)null };
var cache = new Mock<IRuntimeCacheProvider>();
var cache = new Mock<IAppPolicedCache>();
cache.Setup(x => x.GetCacheItem(It.IsAny<string>())).Returns(() => new DeepCloneableList<AuditItem>(ListCloneBehavior.CloneOnce)
cache.Setup(x => x.Get(It.IsAny<string>())).Returns(() => new DeepCloneableList<AuditItem>(ListCloneBehavior.CloneOnce)
{
new AuditItem(1, AuditType.Copy, 123, "test", "blah"),
new AuditItem(2, AuditType.Copy, 123, "test", "blah2")
@@ -169,8 +169,8 @@ namespace Umbraco.Tests.Cache
};
var cacheCleared = false;
var cache = new Mock<IRuntimeCacheProvider>();
cache.Setup(x => x.ClearCacheItem(It.IsAny<string>()))
var cache = new Mock<IAppPolicedCache>();
cache.Setup(x => x.Clear(It.IsAny<string>()))
.Callback(() =>
{
cacheCleared = true;
@@ -201,8 +201,8 @@ namespace Umbraco.Tests.Cache
};
var cacheCleared = false;
var cache = new Mock<IRuntimeCacheProvider>();
cache.Setup(x => x.ClearCacheItem(It.IsAny<string>()))
var cache = new Mock<IAppPolicedCache>();
cache.Setup(x => x.Clear(It.IsAny<string>()))
.Callback(() =>
{
cacheCleared = true;