public async void Code_WhenNullOrNotThreeCharachter_ShouldHaveValidationError(string code) { A.CallTo(() => _cryptoCurrencyRepository.GetCryptoCurrencyByCodeAsync(code, default)).Returns <CryptoCurrency>(null); var request = new CryptoCurrencyAddRequest() { Code = code }; await _testee.ShouldHaveValidationErrorForAsync(x => x.Code, new AddCryptoCurrencyCommand(request)); }
private async Task <bool> NotContainCryptoCurrencyAlready(AddCryptoCurrencyCommand command, string code, CancellationToken cancellation) { var result = await _cryptoCurrencyRepository.GetCryptoCurrencyByCodeAsync(code, cancellation); return(result == default); }