public void AddDBOTestRecipe() { WebsiteContext C = GetInMemoryDB(); SearchController SC = new SearchController(C); Recipe P = new Recipe(); P.Name = "Cheese"; SC.AddDBO(P, new RecipeSearch(C)); Assert.Equal("Cheese", SC.DBO.ElementAt(0).GetSearchAbleString()); }
public void AddDBOTestEmployee() { WebsiteContext C = GetInMemoryDB(); SearchController SC = new SearchController(C); Employee_Profile P = new Employee_Profile { Name = "Cheese" }; SC.AddDBO(P, new EmployeeSearch(C)); Assert.Equal("Cheese", SC.DBO.ElementAt(0).GetSearchAbleString()); }
public void AddDBOTestNewsItem() { WebsiteContext C = GetInMemoryDB(); SearchController SC = new SearchController(C); News_Item P = new News_Item { Title = "Cheese" }; SC.AddDBO(P, new NewsSearch(C)); Assert.Equal("Cheese", SC.DBO.ElementAt(0).GetSearchAbleString()); }
public void AddDBOTestRecipeWithCounter() { WebsiteContext C = GetInMemoryDB(); SearchController SC = new SearchController(C); Recipe P0 = new Recipe { Name = "Cheese" }; Recipe P1 = new Recipe { Name = "Cheese" }; Recipe P2 = new Recipe { Name = "Cheese" }; SC.AddDBO(P0, new RecipeSearch(C)); SC.AddDBO(P1, new RecipeSearch(C)); SC.AddDBO(P2, new RecipeSearch(C)); Assert.Equal("Cheese", SC.DBO.ElementAt(0).GetSearchAbleString()); Assert.Equal(3, SC.DBO.ElementAt(0).GetCounter()); }