Beispiel #1
0
        public async Task DeleteAssignment_deletes_assignment_from_db()
        {
            var expectedAssignment = new Assignment()
            {
                AssignmentID          = 111,
                AssignmentDescription = "Test description",
                AssignmentName        = "First assignment",
                Priority = Priority.Minor,
                Status   = Status.InProgress,
            };

            _myContext.Assignments.Add(expectedAssignment);
            await _myContext.SaveChangesAsync();

            await _driver.DeleteAssignment(expectedAssignment.AssignmentID);

            var result = await _myContext.Assignments.FirstOrDefaultAsync(r => r.AssignmentID == expectedAssignment.AssignmentID);

            result.Should().Be(default);