Exemplo n.º 1
0
        public async Task DeleteEmployeeHours_WhenNotExists()
        {
            await dbContext.EmployeeHoursCollection.AddAsync(
                new EmployeeHours { EmployeeHoursId = 101, Value = 100f, TimePeriod = "02.01.2019_08.01.2019", EmployeeId = 4 });

            await dbContext.EmployeeHoursCollection.AddAsync(
                new EmployeeHours { EmployeeHoursId = 102, Value = 100f, TimePeriod = "02.01.2019_08.01.2019", EmployeeId = 4 });

            await dbContext.SaveChangesAsync();

            var dao = new PostgresDataAccessObjectService(dbContext);

            var coll = dao.GetEmployeeHoursForAnEmployee(4);

            Assert.Equal(2, coll.Count);

            dao.DeleteEmployeeHours(100);

            coll = dao.GetEmployeeHoursForAnEmployee(4);
            Assert.Equal(2, coll.Count);
        }