private void incomeEdit_Click_1(object sender, EventArgs e) { string incomeSelected = incomeLv.SelectedItems[0].SubItems[0].Text; var createNewIncome = new EditIncomeForm(_year.GetIncomeSource(incomeSelected), _year); createNewIncome.NewIncomeAdded += RefreshPage_Handler; createNewIncome.Show(); }
public void SimpleIncomeTest() { decimal checkingExpected = yearTop.GetAccount("checking").CurrentBalance; yearTop.GetIncomeSource("salary").MakeDeposits(new DateTime(2020, 1, 10)); checkingExpected += yearTop.GetIncomeSource("salary").PaydayAmount; Assert.AreEqual(checkingExpected, yearTop.GetAccount("checking").CurrentBalance); yearTop.GetIncomeSource("salary").MakeDeposits(new DateTime(2020, 1, 23)); //checkingExpected += yearTop.GetIncomeSource("salary").PaydayAmount; Assert.AreEqual(checkingExpected, yearTop.GetAccount("checking").CurrentBalance); yearTop.GetIncomeSource("salary").MakeDeposits(new DateTime(2020, 1, 24)); checkingExpected += yearTop.GetIncomeSource("salary").PaydayAmount; Assert.AreEqual(checkingExpected, yearTop.GetAccount("checking").CurrentBalance); checkingExpected = yearTop.GetAccount("checking").StartingBalance + yearTop.GetIncomeSource("salary").AnnualAmount; yearTop.GetIncomeSource("salary").MakeDeposits(new DateTime(2020, 12, 31)); Assert.AreEqual(checkingExpected, yearTop.GetAccount("checking").CurrentBalance); }