public void Tag_AddTagsToOneRecipe_True() { //arrange = manual data // add one recipe and two tags Recipe newRecipe = new Recipe("soup", "heat up"); newRecipe.Save(); Tag firstTag = new Tag("first"); Tag secondTag = new Tag("second"); firstTag.Save(); secondTag.Save(); //Act newRecipe.AddTag(firstTag); newRecipe.AddTag(secondTag); List <Tag> result = newRecipe.GetTags(); List <Tag> expected = new List <Tag> { firstTag, secondTag }; Assert.Equal(result, expected); }
public void AddTag_AddTagsToOneRecipe_True() { //Arrange Recipe testRecipe = new Recipe("Soup", "Heat up Soup"); testRecipe.Save(); Tag firstTag = new Tag("Hearty"); firstTag.Save(); Tag secondTag = new Tag("Soupy"); secondTag.Save(); //Act testRecipe.AddTag(firstTag); testRecipe.AddTag(secondTag); List <Tag> result = testRecipe.GetTags(); List <Tag> testList = new List <Tag> { firstTag, secondTag }; //Assert Assert.Equal(testList, result); }
public void GetTags_ReturnAllTagsFromOneRecipe_True() { Recipe testRecipe = new Recipe("soup", "heat the soup"); testRecipe.Save(); Tag firstTag = new Tag("soupy"); Tag secondTag = new Tag("tasty"); firstTag.Save(); secondTag.Save(); testRecipe.AddTag(firstTag); testRecipe.AddTag(secondTag); List <Tag> expectedTags = new List <Tag> { firstTag, secondTag }; List <Tag> resultTags = testRecipe.GetTags(); Assert.Equal(resultTags, expectedTags); }
public void GetTags_ReturnsAllTagsFromOneRecipe_True() { //Arrange Recipe testRecipe = new Recipe("Soup", "Heat that soup!"); testRecipe.Save(); Tag firstTag = new Tag("Hearty"); firstTag.Save(); Tag secondTag = new Tag("Soupy"); secondTag.Save(); //Act testRecipe.AddTag(firstTag); testRecipe.AddTag(secondTag); List <Tag> testTags = testRecipe.GetTags(); List <Tag> contolTags = new List <Tag> { firstTag, secondTag }; //Assert Assert.Equal(contolTags, testTags); }
public void AddTag_OneRecipe_TagAddedToJoinTable() { //Arrange Recipe testRecipe = new Recipe("Spaghetti", "<Pasta, <Marinara Sauce", "Boil water, cook pasta, strain pasta, add sauce", 5, "30 mins"); testRecipe.Save(); Tag testTag = new Tag("Japanese"); testTag.Save(); testRecipe.AddTag(testTag); //Act List <Tag> output = testRecipe.GetTag(); List <Tag> verify = new List <Tag> { testTag }; //Assert Assert.Equal(verify, output); }