public void MonthService_GetTotalFlowPerCatgegoriesForMonth_Duplicates_In_Both() { var expenseData = Enumerable.Range(1, 5) .Select(i => new Expense { Amount = 1, Date = DateTime.Today, Category = new ExpenseCategory(1, "test") }) .ToList(); expenseData = expenseData.Concat(Enumerable.Range(1, 5) .Select(i => new Expense { Amount = 1, Date = DateTime.Today, Category = new ExpenseCategory(1, "e-test2") })) .ToList(); var incomeData = Enumerable.Range(1, 5) .Select(i => new Income { Amount = 1, Date = DateTime.Today, Category = new IncomeCategory(1, "test") }) .ToList(); incomeData = incomeData.Concat(Enumerable.Range(1, 5) .Select(i => new Income { Amount = 1, Date = DateTime.Today, Category = new IncomeCategory(1, "e-test2") })) .ToList(); var mock = ServiceMocks.GetMockMonthService(expenseData, incomeData); var actual = mock.GetTotalFlowPerCategoriesForMonth(DateTime.Today); var expected = new Dictionary <string, decimal> { ["Total Expenses"] = 10, ["Total Income"] = 10, ["test - Expense"] = 5, ["e-test2 - Expense"] = 5, ["e-test2 - Income"] = 5, ["test - Income"] = 5 }; CollectionAssert.AreEquivalent(expected, actual); }
public void MonthService_GetTotalForCategoryAndMonth_CategoryName_Is_Whitespace_Throws_Exception() { var mock = ServiceMocks.GetMockMonthService(); mock.GetTotalForCategoryAndMonth("something", string.Empty, DateTime.Today); }
public void MonthService_GetTotalForCategoryAndMonth_CategoryName_Is_Null_Throws_Exception() { var mock = ServiceMocks.GetMockMonthService(); mock.GetTotalForCategoryAndMonth("something", null, DateTime.Today); }
public void MonthService_GetTotalForCategoryAndMonth_CategoryType_Is_Whitespace_Throws_Exception() { var mock = ServiceMocks.GetMockMonthService(); mock.GetTotalForCategoryAndMonth("\r\t\n\t", "something", DateTime.Today); }