public async Task ThenFalseIsReturnedIfAccessCodeIsEmptyOrWhiteSpace(string accessCode) { var command = new ActivateUserCommandBuilder() .WithValidUser() .WithAccessCode(accessCode) .Build(); var result = await _activateUserCommandValidator.ValidateAsync(command); Assert.IsFalse(result.IsValid()); }
public async Task ThenFalseIsReturnedIfAccessCodeIsNull() { var command = new ActivateUserCommandBuilder() .WithValidUser() .WithNullAccessCode() .Build(); var result = await _activateUserCommandValidator.ValidateAsync(command); Assert.IsFalse(result.IsValid()); }
public async Task ThenResultContainsMissingCodeMessageIfAccessCodeIsNull() { var command = new ActivateUserCommandBuilder() .WithValidUser() .WithNullAccessCode() .Build(); var result = await _activateUserCommandValidator.ValidateAsync(command); Assert.IsTrue( result .ValidationDictionary.Values.Any(message => message.Equals(MissingCodeMessage, StringComparison.Ordinal)) ); }