public void IsInvalidIfPasswordDoesNotMatchPolicy()
 {
     foreach (var invalidPassword in TestData.Password.Invalid.All)
     {
         _registerAccountCommand.Password = invalidPassword;
         CommandValidator.ValidationFailures(_registerAccountCommand).Should().NotBeEmpty();
     }
 }
 public void CreateValidCommand()
 {
     _registerAccountCommand = new RegisterAccountCommand()
     {
         AccountId = Guid.NewGuid(),
         Email     = "*****@*****.**",
         Password  = "******"
     };
     CommandValidator.ValidationFailures(_registerAccountCommand).Should().BeEmpty();
 }
 private string ValidateAndGetFirstMessage()
 {
     return(CommandValidator.ValidationFailures(_registerAccountCommand).First().ErrorMessage);
 }
 public void IsInvalidIfPasswordIsNull()
 {
     _registerAccountCommand.Password = null;
     CommandValidator.ValidationFailures(_registerAccountCommand).Should().NotBeEmpty();
 }
 public void IsInvalidIfEmailIsIncorrectFormat()
 {
     _registerAccountCommand.Email = "invalid";
     CommandValidator.ValidationFailures(_registerAccountCommand).Should().NotBeEmpty();
 }
 public void IsInvalidifAccountIdIsEmpty()
 {
     _registerAccountCommand.AccountId = Guid.Empty;
     CommandValidator.ValidationFailures(_registerAccountCommand).Should().NotBeEmpty();
 }