public void ValidDrug_GetSuggestedDoses_Success() { // Arrange Drug drug = DrugFactory.GetDrug("testname1", "testIndication1", "testRoute"); // Act IList <SuggestedDose> result = SuggestedDoseService.GetSuggestedDoses(drug); // Assert Assert.Single(result); Assert.Equal("testIndication1", result.FirstOrDefault().Indications.FirstOrDefault()); Assert.Equal("TestRoute", result.FirstOrDefault().DoseAdministrations.FirstOrDefault().Route); }
public void ValidDrugInput_Serialize_Success() { // Arrange IList <Drug> drugs = new List <Drug> { DrugFactory.GetDrug("testname1", "testIndication1", "testRoute"), DrugFactory.GetDrug("testname2", "testIndication2", "testRoute") }; DrugsInput input = new DrugsInput { Drugs = drugs }; SerializeCommand command = new SerializeCommand(input); // Act var result = command.Execute(); // Assert Assert.Contains("testname1", result); Assert.Contains("testIndication1", result); Assert.Contains("testname2", result); Assert.Contains("testIndication2", result); Assert.DoesNotContain("testRoute", result); Assert.Contains("TestRoute", result); }