예제 #1
0
        public async Task CreateExpense_CorrectData_ReturnSuccesMessage()
        {
            Expense GoodExpense1 = new Expense
            {
                Title = "Expense21",
                Value = 12
            };
            var Expense = await ExpensesControl.CreateExpense(GoodExpense1);

            Assert.AreEqual("Expense has been created!", Expense.SuccessMessage);
        }
예제 #2
0
        public async Task CreateExpense_ExpenseAddedToDatabase_RetrunTrue()
        {
            Expense GoodExpense1 = new Expense
            {
                Title = "Expense21",
                Value = 12
            };
            var Expense = await ExpensesControl.CreateExpense(GoodExpense1);

            var ExpenseCount = databaseContext.Expenses.Count();

            //one is added by default
            Assert.AreEqual(2, ExpenseCount);
        }
예제 #3
0
        public async Task GetACcountBalance_AddIncomeAndExpense_ReturnCorrectBalance()
        {
            Income TestIncome = new Income
            {
                Title = "Income",
                Value = 100
            };

            Expense TestExpense = new Expense
            {
                Title = "Expense21",
                Value = 10
            };

            var Income = await IncomesControl.CreateIncome(TestIncome);

            var Expense = await ExpensesControl.CreateExpense(TestExpense);

            var Balance = await AccountsControl.GetAccountBalance();

            Assert.AreEqual(90, Balance.Data);
        }