Ejemplo n.º 1
0
        public async Task ExpenseRepository_AddExpense_Added_NotFail_Test()
        {
            var context  = new MyCompanyContext();
            int expected = context.Expenses.Count() + 1;

            var employeeId = context.Employees.FirstOrDefault().EmployeeId;
            var expense    = new Expense()
            {
                Name             = "Bussiness",
                Description      = "Lorem ipsum dolor sit amet.",
                CreationDate     = DateTime.UtcNow.AddDays(-1),
                LastModifiedDate = DateTime.UtcNow,
                Status           = ExpenseStatus.Approved,
                Amount           = 270,
                Contact          = "Jeff Phillips",
                Picture          = null,
                ExpenseType      = Model.ExpenseType.Accommodation,
                RelatedProject   = "MyCompany",
                EmployeeId       = employeeId,
            };
            await target.AddAsync(expense);

            int actual = context.Expenses.Count();

            Assert.AreEqual(expected, actual);
        }