public void Test_ReturnsAllDiseases_DiseaseList() { Remedy testRemedy = new Remedy("Herbal", "descriptionHerbal", "sideEffectHerbal", "website.com/photoOfRemedy.jpg", 1); testRemedy.Save(); Disease testDisease1 = new Disease("cold", "running nose", "image1", 1); testDisease1.Save(); Disease testDisease2 = new Disease("flu", "sick", "image1", 2); testDisease2.Save(); testRemedy.AddDisease(testDisease1); testRemedy.AddDisease(testDisease2); List <Disease> result = testRemedy.GetDisease(); List <Disease> testList = new List <Disease> { testDisease1, testDisease2 }; Assert.Equal(testList, result); }
public void AddDisease_AddsDiseasesToRemedy_DiseaseList() { Remedy testRemedy = new Remedy("Herbal", "descriptionHerbal", "sideEffectHerbal", "website.com/photoOfRemedy.jpg", 1); testRemedy.Save(); Disease testDisease = new Disease("cold", "running nose", "image1", 1); testDisease.Save(); testRemedy.AddDisease(testDisease); List <Disease> result = testRemedy.GetDisease(); List <Disease> testList = new List <Disease> { testDisease }; Assert.Equal(testList, result); }
public void Delete_DeletesRemedyAssociationsFromDataBase_RemedyList() { Disease testDisease = new Disease("cold", "running nose", "image1", 1); testDisease.Save(); Remedy testRemedy = new Remedy("Herbal", "descriptionHerbal", "sideEffectHerbal", "website.com/photoOfRemedy.jpg", 1); testRemedy.Save(); testRemedy.AddDisease(testDisease); testRemedy.Delete(); List <Remedy> result = testDisease.GetRemedy(); List <Remedy> test = new List <Remedy> { }; Assert.Equal(test, result); }