private WebsiteContext GetInMemoryDBWithSeeder()
        {
            WebsiteContext C = GetInMemoryDB();

            SeederInMemoryDB.Seed(C);
            return(C);
        }
Example #2
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);
 }
Example #4
0
 public ProductsControllerTest()
 {
     DB      = new InMemoryDB();
     context = DB.GetInMemoryDB(true);
     SeederInMemoryDB.Seed(context);
     c = new ProductsController(context);
 }
Example #5
0
        public void Testcounter()
        {
            InMemoryDB     DB = new InMemoryDB();
            WebsiteContext C  = DB.GetInMemoryDB(true);

            SeederInMemoryDB.Seed(C);
            Assert.Equal(1, DB.ProductPKConvert(C.Products.ToList().ElementAt(0).ArticleNumber));
            Assert.Equal(2, DB.ProductPKConvert(C.Products.ToList().ElementAt(1).ArticleNumber));
            Assert.Equal(3, DB.ProductPKConvert(C.Products.ToList().ElementAt(2).ArticleNumber));
            Assert.Equal(4, DB.ProductPKConvert(C.Products.ToList().ElementAt(3).ArticleNumber));
        }
Example #6
0
        public void TestSeeder()
        {
            InMemoryDB     DB = new InMemoryDB();
            WebsiteContext C  = DB.GetInMemoryDB(true);

            SeederInMemoryDB.Seed(C);
            Assert.Equal("Chicken", C.Branch_Categories.ToList().ElementAt(0).Name);
            Assert.Equal("ChickenSoup", C.Type_Categories.ToList().ElementAt(0).Name);
            Assert.Equal("SaltChicken", C.Normal_Categories.ToList().ElementAt(0).Name);
            Assert.Equal(2, C.Type_Categories.ToList().Count());
            Assert.Equal(4, C.Normal_Categories.ToList().Count());
            Assert.Equal(3, C.Recipes.ToList().Count());
            Assert.Equal(3, C.TypeCategory_Recipes.ToList().Count());
            Assert.Equal((double)2.56, C.TypeCategory_Recipes.ToList().ElementAt(2).Weight);
        }