Esempio n. 1
0
        public void getAllByFilterTest()
        {
            using (WebActionExecutor executor = new WebActionExecutor()){
                IContentContainer      container = getContainer();
                List <TestContentType> contents  = new List <TestContentType>(from int i in Enumerable.Range(0, rnd.Next(10) + 2)
                                                                              select TestContentType.getARandomTestContentType(enforce_a_reference: false));

                container.AddContents(contents);


                Assert.IsTrue(container.GetAllByFilter <TestContentType>(
                                  x => x.a_string == contents[0].a_string || x.a_string == contents[1].a_string)
                              .sameContents(contents.Take(2)));
            }
        }
 public IEnumerable <T> GetAllByFilter <T>(Expression <Func <T, bool> > filter) where T : IContent, new()
 {
     return(_storage.GetAllByFilter <T>(filter));
 }