public async Task DeleteAsync_Should_Delete_Entity_From_Database() { // Arrange var todoItem = Builder <TodoItem> .CreateNew().With(c => c.Id = Guid.NewGuid()).Build(); TodoItemRepository.GetFirstAsync(Arg.Any <Expression <Func <TodoItem, bool> > >()).Returns(todoItem); TodoItemRepository.DeleteAsync(Arg.Any <TodoItem>()).Returns(todoItem); // Act var result = await _sut.DeleteAsync(Guid.NewGuid()); // Assert result.Id.Should().Be(todoItem.Id); await TodoItemRepository.Received().GetFirstAsync(Arg.Any <Expression <Func <TodoItem, bool> > >()); await TodoItemRepository.Received().DeleteAsync(Arg.Any <TodoItem>()); }