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 GetFinancialAssessment_Failed() { // Arrange var controller = new FinancialAssessmentController(new FinancialAssessmentRepository(token)); // Act var modelResponse = controller.GetFinancialAssessment(0, 0).Result; // Assert Assert.IsNull(modelResponse); }
public void DeleteFinancialAssessment_Failed() { // Arrange var controller = new FinancialAssessmentController(new FinancialAssessmentRepository(token)); // Act var modelResponse = controller.DeleteFinancialAssessmentDetail(financialAssessmentDetailFailedID, DateTime.UtcNow); // Assert Assert.IsNotNull(modelResponse); Assert.IsTrue(modelResponse.RowAffected == 0); }
public void GetFinancialAssessment_Success() { // Arrange var controller = new FinancialAssessmentController(new FinancialAssessmentRepository(token)); // Act var modelResponse = controller.GetFinancialAssessment(contactId, financialAssessmentID).Result; // Assert Assert.IsNotNull(modelResponse); Assert.IsNotNull(modelResponse.DataItems); Assert.IsTrue(modelResponse.DataItems.Count > 0); }
public void SaveFinancialAssessmentDetails_Failed() { // Arrange FinancialAssessment_Failed_data(); var controller = new FinancialAssessmentController(new FinancialAssessmentRepository(token)); // Act var modelResponse = controller.AddFinancialAssessmentDetails(financialAssessmentDetailsModel); // Assert Assert.IsNotNull(modelResponse); Assert.IsTrue(modelResponse.RowAffected == 0); }
public void SaveFinancialAssessment_Success() { // Arrange FinancialAssessment_Success_data(); var controller = new FinancialAssessmentController(new FinancialAssessmentRepository(token)); // Act var modelResponse = controller.AddFinancialAssessment(financialAssessmentViewModel); // Assert Assert.IsNotNull(modelResponse); Assert.IsTrue(modelResponse.RowAffected > 0); }
public void DeleteFinancialAssessment_Success() { // Arrange FinancialAssessment_Success(); financialAssessmentController = new FinancialAssessmentController(financialAssessmentDataProvider); //Act var deleteFinancialAssessmentResult = financialAssessmentController.DeleteFinancialAssessmentDetail(financialAssessmentDetailID, DateTime.UtcNow); var response = deleteFinancialAssessmentResult as HttpResult <Response <bool> >; // Assert Assert.IsNotNull(response); Assert.AreEqual(1, response.Value.RowAffected, "Financial assessment details could not be deleted."); }
public void AddFinancialAssessmentDetails_Failed() { // Arrange FinancialAssessment_Failed(); financialAssessmentController = new FinancialAssessmentController(financialAssessmentDataProvider); //Act var getFinancialAssessmentResult = financialAssessmentController.AddFinancialAssessmentDetails(emptyFinancialAssessmentDetailsModel); var response = getFinancialAssessmentResult as HttpResult <Response <FinancialAssessmentDetailsModel> >; //Assert Assert.IsNotNull(response); Assert.IsNotNull(response.Value); Assert.IsTrue(response.Value.RowAffected == 0); }
public void DeleteFinancialAssessment_Failed() { // Arrange FinancialAssessment_Failed(); financialAssessmentController = new FinancialAssessmentController(financialAssessmentRuleEngine); //Act var deleteFinancialAssessmentResult = financialAssessmentController.DeleteFinancialAssessmentDetail(financialAssessmentDetailID, DateTime.UtcNow); var response = deleteFinancialAssessmentResult as HttpResult <Response <bool> >; //Assert Assert.IsNotNull(response); Assert.IsNotNull(response.Value); Assert.AreEqual(0, response.Value.RowAffected, "Financial assessment details deleted."); }
public void UpdateFinancialAssessmentDetails_Success() { // Arrange FinancialAssessment_Success(); financialAssessmentController = new FinancialAssessmentController(financialAssessmentDataProvider); //Act var getFinancialAssessmentResult = financialAssessmentController.UpdateFinancialAssessmentDetails(financialAssessmentDetail); var response = getFinancialAssessmentResult as HttpResult <Response <FinancialAssessmentDetailsModel> >; //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 GetFinancialAssessment_Failed() { // Arrange FinancialAssessment_Failed(); financialAssessmentController = new FinancialAssessmentController(financialAssessmentDataProvider); //Act var getFinancialAssessmentResult = financialAssessmentController.GetFinancialAssessment(0, 0); 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.DataItems.Count == 0); }
public void GetFinancialAssessment_Success() { // Arrange FinancialAssessment_Success(); financialAssessmentController = new FinancialAssessmentController(financialAssessmentDataProvider); //Act var getFinancialAssessmentResult = financialAssessmentController.GetFinancialAssessment(contactId, financialAssessmentID); 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.DataItems.Count > 0, "Atleast one Financial Assessment must exists."); }
public void UpdateFinancialAssessmentDetails_Failed() { // Arrange FinancialAssessment_Failed(); financialAssessmentController = new FinancialAssessmentController(financialAssessmentRuleEngine); //Act var getFinancialAssessmentResult = financialAssessmentController.UpdateFinancialAssessmentDetails(emptyFinancialAssessmentDetailsModel); var response = getFinancialAssessmentResult as HttpResult <Response <FinancialAssessmentDetailsModel> >; var financialAssessment = response.Value.DataItems; //Assert Assert.IsNotNull(response); Assert.IsNotNull(response.Value); Assert.IsTrue(response.Value.RowAffected == 0); }
public void AddFinancialAssessment_Success() { // Arrange FinancialAssessment_Success(); financialAssessmentController = new FinancialAssessmentController(financialAssessmentRuleEngine); //Act var getFinancialAssessmentResult = financialAssessmentController.AddFinancialAssessment(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 updateFinancialAssessmentDetails_Success() { // Arrange var controller = new FinancialAssessmentController(new FinancialAssessmentRepository(token)); // Act financialAssessmentDetailsModel = new FinancialAssessmentDetailsModel() { FinancialAssessmentDetailsID = 1, FinancialAssessmentID = 1, CategoryTypeID = 1, Amount = 100, FinanceFrequencyID = 17, CategoryID = 1 }; var modelResponse = controller.UpdateFinancialAssessmentDetails(financialAssessmentDetailsModel); // Assert Assert.IsNotNull(modelResponse); Assert.IsTrue(modelResponse.RowAffected > 0); }