public void updateFinancialAssessment_Failed() { // Arrange var controller = new FinancialAssessmentController(new FinancialAssessmentRepository(token)); // Act financialAssessmentViewModel = new FinancialAssessmentViewModel() { ContactID = 0, FinancialAssessmentID = 1, AssessmentDate = DateTime.Now, TotalIncome = 300000, TotalExpenses = 30000, AdjustedGrossIncome = 5000, TotalExtraOrdinaryExpenses = 100, TotalOther = 100, ExpirationDate = DateTime.Now, ExpirationReasonID = 0, FamilySize = 2 }; var modelResponse = controller.UpdateFinancialAssessment(financialAssessmentViewModel); // Assert Assert.IsNotNull(modelResponse); Assert.IsTrue(modelResponse.RowAffected == 0); }
public void UpdateFinancialAssessment_Success() { // Arrange FinancialAssessment_Success(); financialAssessmentController = new FinancialAssessmentController(financialAssessmentDataProvider); //Act var getFinancialAssessmentResult = financialAssessmentController.UpdateFinancialAssessment(financialAssessmentModel); var response = getFinancialAssessmentResult as HttpResult <Response <FinancialAssessmentModel> >; //Assert Assert.IsNotNull(response); Assert.IsNotNull(response.Value); Assert.IsNotNull(response.Value.DataItems, "Data items can't be null"); Assert.IsTrue(response.Value.RowAffected > 0); }
public void UpdateFinancialAssessment_Failed() { // Arrange FinancialAssessment_Failed(); financialAssessmentController = new FinancialAssessmentController(financialAssessmentDataProvider); //Act var getFinancialAssessmentResult = financialAssessmentController.UpdateFinancialAssessment(emptyFinancialAssessmentModel); var response = getFinancialAssessmentResult as HttpResult <Response <FinancialAssessmentModel> >; var financialAssessment = response.Value.DataItems; //Assert Assert.IsNotNull(response); Assert.IsNotNull(response.Value); Assert.IsNull(response.Value.DataItems); Assert.IsTrue(response.Value.RowAffected == 0); }