private void BuildOverview() { MonthName = monthYear.GetMonthName(); Year = monthYear.Year; TotalIncome = summary.GetTotalIncome(); Expenses = FormatExpenses(); PendingStatements = FormatPendingStatements(); BankAmount = summary.GetCurrentBalance(); InitialBankAmount = summary.GetInitialBalance(); Categories = GetCategories(); }
public void GetCurrentBalance_FutureBankStatementsAndPaidStatements() { // Arrange var statementList = BuildStatementList(); List <Bank> bankList = BuildBankWithStatements(DateTime.Parse("2018-04-20")); var summary = new MonthSummary(statementList, bankList); // Act decimal result = summary.GetCurrentBalance(); // Assert Assert.Equal(401m, result); }
public void GetCurrentBalance_NoBankStatementsAndPaidStatements() { // Arrange var statementList = BuildStatementList(); List <Bank> bankList = new List <Bank>() { new Bank() }; var summary = new MonthSummary(statementList, bankList); // Act decimal result = summary.GetCurrentBalance(); // Assert Assert.Equal(-500.20m, result); }
public void GetCurrentBalance_MultipleStatementsInOneBank() { // Arrange var statementList = new List <Statement>(); var bankList = new List <Bank>() { BuildBank(1, new List <BankStatement> { BuildBankStatement(200.50m, DateTime.Parse("2018-04-01")), BuildBankStatement(300.80m, DateTime.Parse("2018-04-02")) }) }; var summary = new MonthSummary(statementList, bankList); // Act decimal result = summary.GetCurrentBalance(); // Assert Assert.Equal(300.80m, result); }