public void Should_Delete_Task() { //Arrange var defaultTask = UsingDbContext(ctx => ctx.Tasks.FirstOrDefault()); //Act _taskAppService.DeleteTask(defaultTask.Id); //Assert var task = UsingDbContext(ctx => ctx.Tasks.FirstOrDefault(t => t.Id == defaultTask.Id)); task.ShouldBeNull(); }