Example #1
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 IEnumerable <T> GetAll <T>() where T : IContent, new()
 {
     return(_storage.GetAll <T>());
 }