public void DeleteTest() { //Arrange var options = new DbContextOptionsBuilder <TodoContext>() .UseInMemoryDatabase(databaseName: "TODOs") .Options; var todoModel = new TodoModel { Details = "Test todo", DueDate = new System.DateTime() }; var context = new TodoContext(options); var todoService = new TodoService(context); var createdTodo = todoService.CreateTodo(todoModel).Result; //Act todoService.DeleteTodo(createdTodo.Id).Wait(); //Assert var result = todoService.FindOne(createdTodo.Id).Result; Assert.IsNull(result); }