public void Will_not_update_owed_CHB_when_generating_ad_hoc_data_if_user_says_no() { // Arrange var bank_and_bank_out_loader = new BankAndBankOutLoader(); var mock_spreadsheet = new Mock <ISpreadsheet>(); var mock_input_output = new Mock <IInputOutput>(); mock_input_output.Setup(x => x.Get_input(It.Is <string>(y => y.Contains("CHB")), "")) .Returns("N"); // Act bank_and_bank_out_loader.Generate_ad_hoc_data( mock_input_output.Object, mock_spreadsheet.Object, new Mock <ICSVFile <BankRecord> >().Object, new BudgetingMonths { Start_year = 2020, Next_unplanned_month = 6, Last_month_for_budget_planning = 6, Do_expected_out_budgeting = true }, new DataLoadingInformation <ActualBankRecord, BankRecord>() ); // Assert mock_spreadsheet.Verify(x => x.Update_owed_CHB(It.IsAny <BudgetingMonths>()), Times.Never); }
public void Will_not_update_any_amounts_when_generating_ad_hoc_data_if_user_wants_no_expected_out_budgeting() { // Arrange var bank_and_bank_out_loader = new BankAndBankOutLoader(); var mock_spreadsheet = new Mock <ISpreadsheet>(); var budgeting_months = new BudgetingMonths { Start_year = 2020, Next_unplanned_month = 6, Last_month_for_budget_planning = 6, Do_expected_out_budgeting = false }; // Act bank_and_bank_out_loader.Generate_ad_hoc_data( new Mock <IInputOutput>().Object, mock_spreadsheet.Object, new Mock <ICSVFile <BankRecord> >().Object, budgeting_months, new DataLoadingInformation <ActualBankRecord, BankRecord>() ); // Assert mock_spreadsheet.Verify(x => x.Update_owed_CHB(It.IsAny <BudgetingMonths>()), Times.Never); mock_spreadsheet.Verify(x => x.Update_expected_out( It.IsAny <int>(), It.IsAny <string>(), It.IsAny <string>()), Times.Never); }
public void Will_update_groceries_when_generating_ad_hoc_data() { // Arrange var bank_and_bank_out_loader = new BankAndBankOutLoader(); var mock_input_output = new Mock <IInputOutput>(); var mock_spreadsheet = new Mock <ISpreadsheet>(); // Act bank_and_bank_out_loader.Generate_ad_hoc_data( mock_input_output.Object, mock_spreadsheet.Object, new Mock <ICSVFile <BankRecord> >().Object, new BudgetingMonths { Start_year = 2020, Next_unplanned_month = 6, Last_month_for_budget_planning = 6, Do_expected_out_budgeting = true }, new DataLoadingInformation <ActualBankRecord, BankRecord>() ); // Assert mock_spreadsheet.Verify(x => x.Update_expected_out( It.IsAny <int>(), Codes.Code005, Codes.Code075)); mock_input_output.Verify(x => x.Get_input( It.Is <string>(y => y.Contains("grocery shopping")), "")); }