public void SearchBreadTest()
        {
            l1.AddLast(black_bread);
            l1.AddLast(white_bread);
            l1.AddLast(cutted_bread);

            Assert.AreEqual(SearchProducts.Search("bread"), l1);
        }
Example #2
0
        internal static List <SearchProduct> SearchLiteProducts(string searchString)
        {
            ApplicationDbContext context = new ApplicationDbContext();
            var productSearcher          = new SearchProducts();

            productSearcher.ClearLuceneIndex();
            productSearcher.AddUpdateLuceneIndex(context.Products.Include("Category").ToList());
            return(productSearcher.Search(searchString).ToList());
        }
 public void SearchBlackBreadTest()
 {
     l2.AddLast(black_bread);
     Assert.AreEqual(SearchProducts.Search("black bread"), l2);
 }
 public void SearchWhiteBreadTest()
 {
     l2.AddLast(white_bread);
     Assert.AreEqual(SearchProducts.Search("white bread"), l2);
 }
 public void SearchNoResultsTest()
 {
     Assert.AreEqual(SearchProducts.Search("coca cola"), l1);
 }
 public void SearchNoResultsTest()
 {
     Assert.AreEqual(FilterProducts.Filter("chocko", SearchProducts.Search("bread"), "byName"), l1);
 }
 public void SearchBlackBreadTest()
 {
     l1.AddLast(black_bread);
     Assert.AreEqual(FilterProducts.Filter("black bread", SearchProducts.Search("bread"), "byName"), l1);
 }
 public void SearchWhiteBreadTest()
 {
     l1.AddLast(white_bread);
     Assert.AreEqual(FilterProducts.Filter("white bread", SearchProducts.Search("bread"), "byName"), l1);
 }