Beispiel #1
0
        public async Task <ValidateableResponse <CryptoCurrencyDeleteResponse> > Handle(RemoveCryptoCurrencyCommand request,
                                                                                        CancellationToken cancellationToken)
        {
            var result = await _cryptoCurrencyRepository.RemoveCryptoCurrencyAsync(request.Id, cancellationToken);

            return(new ValidateableResponse <CryptoCurrencyDeleteResponse>(new CryptoCurrencyDeleteResponse(result)));
        }
        public async void Handle_ShouldCallAddNewCryptoCurrencyAsync()
        {
            //arrange
            var command = new Application.CQRS.Commands.RemoveCryptoCurrencyCommand(1);

            //act
            await _testee.Handle(command, default);

            //assert
            A.CallTo(() => _cryptoCurrencyRepository.RemoveCryptoCurrencyAsync(command.Id, default)).MustHaveHappenedOnceExactly();
        }