public void GetDiseasesInCategory_InCorrectInputCategotyId_ExpectedException() { // Arrange TestData testData = new TestData(); var mockDataProvider = new Mock <IDataAccessManager>(); mockDataProvider.Setup(mock => mock.GetDiseasesInCategory(testData.disease.CategoryId)). Returns(testData.Diseases); var service = new DiseaseManager(mockDataProvider.Object); // Act List <Disease> diseases = service.GetDiseasesInCategory(testData.disease.CategoryId).ToList(); }
public void GetDiseasesInCategory_CorrectInputCategotyId_ListOfDiseases() { // Arrange TestData testData = new TestData(); var mockDataProvider = new Mock <IDataAccessManager>(); mockDataProvider.Setup(mock => mock.GetDiseaseCategories()).Returns(testData.Categories); mockDataProvider.Setup(mock => mock.GetDiseasesInCategory(testData.disease.CategoryId)). Returns(testData.Diseases); var service = new DiseaseManager(mockDataProvider.Object); // Act List <Disease> diseases = service.GetDiseasesInCategory(testData.disease.CategoryId).ToList(); // Assert CollectionAssert.AreEqual(testData.Diseases, diseases); }