temp - temp media memory cache

This commit is contained in:
Stephan
2015-06-05 15:45:06 +02:00
parent 29b64965ed
commit 8d1cdf020b
3 changed files with 217 additions and 66 deletions

View File

@@ -146,7 +146,7 @@ namespace Umbraco.Tests.Cache.PublishedCache
result.Fields.Add("writerName", "Shannon");
var store = new PublishedMediaCache(ctx.Application);
var doc = store.ConvertFromSearchResult(result);
var doc = store.CreateFromCacheValues(store.ConvertFromSearchResult(result));
DoAssert(doc, 1234, 0, 0, "", "Image", 0, "Shannon", "", 0, 0, "-1,1234", default(DateTime), DateTime.Parse("2012-07-16T10:34:09"), 2);
Assert.AreEqual(null, doc.Parent);
@@ -160,7 +160,7 @@ namespace Umbraco.Tests.Cache.PublishedCache
var xmlDoc = GetMediaXml();
var navigator = xmlDoc.SelectSingleNode("/root/Image").CreateNavigator();
var cache = new PublishedMediaCache(ctx.Application);
var doc = cache.ConvertFromXPathNavigator(navigator);
var doc = cache.CreateFromCacheValues(cache.ConvertFromXPathNavigator(navigator, true));
DoAssert(doc, 2000, 0, 2, "image1", "Image", 2044, "Shannon", "Shannon2", 22, 33, "-1,2000", DateTime.Parse("2012-06-12T14:13:17"), DateTime.Parse("2012-07-20T18:50:43"), 1);
Assert.AreEqual(null, doc.Parent);
@@ -246,12 +246,14 @@ namespace Umbraco.Tests.Cache.PublishedCache
//there is no parent
a => null,
//we're not going to test this so ignore
a => new List<IPublishedContent>(),
(dd, n) => new List<IPublishedContent>(),
(dd, a) => dd.Properties.FirstOrDefault(x => x.PropertyTypeAlias.InvariantEquals(a)),
null,
false),
//callback to get the children
d => children,
(dd, n) => children,
(dd, a) => dd.Properties.FirstOrDefault(x => x.PropertyTypeAlias.InvariantEquals(a)),
null,
false);
return dicDoc;
}