public void AddHPI_Success() { //Act Mock_PresentIllness(); var addHPI = new PresentIllnessModel { HPIID = 2, ContactID = 1, EncounterID = null, TakenBy = 1, TakenTime = DateTime.Now, IsActive = true, ModifiedBy = 5, ModifiedOn = DateTime.Now, ForceRollback = true }; var addHPIResult = PresentIllnessController.AddHPI(addHPI); var response = addHPIResult as HttpResult <Response <PresentIllnessModel> >; //Assert Assert.IsNotNull(response, "Response can't be null"); Assert.IsNotNull(response.Value, "Response value can't be null"); Assert.IsNotNull(response.Value.DataItems, "Response value can't be null"); Assert.IsTrue(response.Value.DataItems.Count == 2, "HPI could not be created."); }
public void AddHPI_Success() { // Act var srModel = new PresentIllnessViewModel { HPIID = 0, ContactID = 1, EncounterID = null, TakenBy = 1, TakenTime = DateTime.Now, ForceRollback = true }; var response = controller.AddHPI(srModel); // Assert Assert.IsNotNull(response, "Response can not be null"); Assert.IsTrue(response.ID > 0, "Present Illness could not be created."); }