public void ClearTest() { IContentContainer container = getContainer(); List <IContent> contents = new List <IContent>(from int i in Enumerable.Range(0, rnd.Next(10) + 2) select TestContentType.getARandomTestContentType(enforce_a_reference: false)); container.AddContents(contents); container.Clear(); Assert.AreEqual(container.Count, 0); }
public void getAllTest() { using (WebActionExecutor executor = new WebActionExecutor()) { IContentContainer container = getContainer(); container.Clear(); List <IContent> contents = new List <IContent>(from int i in Enumerable.Range(0, rnd.Next(10) + 2) select TestContentType.getARandomTestContentType(enforce_a_reference: false)); container.AddContents(contents); List <IContent> type2 = new List <IContent>(from int i in Enumerable.Range(0, rnd.Next(10) + 2) select new TestContentType2()); container.AddContents(type2); Assert.IsTrue(container.GetAll <TestContentType2>().sameContents(type2)); Assert.IsTrue(container.GetAll <TestContentType>().sameContents(type2.Union(contents))); } }
public void Clear() { _cache = new ConcurrentDictionary <Guid, IContent>(); _storage.Clear(); }