public SubscriptionControllerTest() { DB = new InMemoryDB(); context = DB.GetInMemoryDB(true); SeederInMemoryDB.Seed(context); c = new SubscriptionController(context); }
private WebsiteContext GetInMemoryDB() { InMemoryDB DB = new InMemoryDB(); WebsiteContext C = DB.GetInMemoryDB(true); return(C); }
public RecipesControllerTest() { DB = new InMemoryDB(); context = DB.GetInMemoryDB(true); SeederInMemoryDB.Seed(context); rc = new RecipesController(context); }
public ProductsControllerTest() { DB = new InMemoryDB(); context = DB.GetInMemoryDB(true); SeederInMemoryDB.Seed(context); c = new ProductsController(context); }
public void TestGetSelectedTypes() { //Test #1 int i = context.Type_Categories.ToList()[0].TypeID; string[] array = new string[] { "T " + i }; var result = c.getTypes(array); Assert.Equal(i, result.ToList()[0].TypeID); //Test #2 context = DB.GetInMemoryDB(true); array = new string[] { "SKJHGD" }; var result1 = c.getTypes(array); Assert.Empty(result1.ToList()); }
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)); }
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); }