Beispiel #1
0
 public SubscriptionControllerTest()
 {
     DB      = new InMemoryDB();
     context = DB.GetInMemoryDB(true);
     SeederInMemoryDB.Seed(context);
     c = new SubscriptionController(context);
 }
 public RecipesControllerTest()
 {
     DB      = new InMemoryDB();
     context = DB.GetInMemoryDB(true);
     SeederInMemoryDB.Seed(context);
     rc = new RecipesController(context);
 }
Beispiel #3
0
 public ProductsControllerTest()
 {
     DB      = new InMemoryDB();
     context = DB.GetInMemoryDB(true);
     SeederInMemoryDB.Seed(context);
     c = new ProductsController(context);
 }
Beispiel #4
0
        public void TestGetSelectedCats()
        {
            //Test #1
            int i = context.Normal_Categories.ToList()[0].CategoryID;

            string[] array  = new string[] { "C " + i };
            var      result = c.GetCategories(array);

            Assert.Equal(i, result.ToList()[0].CategoryID);


            //Test #2
            context = DB.GetInMemoryDB(true);

            array = new string[] { "SKJHGD" };
            var result1 = c.GetCategories(array);

            Assert.Empty(result1.ToList());
        }