public async void DeleteSearchCommandHandler_should_delete_search()
        {
            // Arrange
            A.CallTo(() => _mongoDBService.RemoveAsync(A <string> .Ignored)).Returns(1);
            var command = new DeleteSearchCommand
            {
                Id = "1254785369874"
            };

            // Act
            var result = await _deleteSearchCommandHandler.Handle(command, default);

            // Assert
            A.CallTo(() => _mongoDBService.RemoveAsync(A <string> .Ignored)).MustHaveHappenedOnceExactly();
            Assert.Equal(1, result);
        }
Beispiel #2
0
 public async Task <long> Handle(DeleteSearchCommand request, CancellationToken cancellationToken)
 {
     return(await _mongoDBService.RemoveAsync(request.Id));
 }