Exemple #1
0
        public void Should_FailValidation_When_GivenEmptyUsername()
        {
            // Arrange
            var userAccount  = new UserAccount(username: "", password: "******", isActive: false, isFirstTimeUser: false, roleType: "public");
            var passwordSalt = new PasswordSalt(salt: "@$!@#a2131asda@#!");
            var createFirstTimeSsoUserPostLogicValidationStrategy = new CreateFirstTimeSsoUserPostLogicValidationStrategy(userAccount, passwordSalt);

            // Act
            var result = createFirstTimeSsoUserPostLogicValidationStrategy.ExecuteStrategy();

            // Assert
            result.Data.Should().BeFalse();
            result.Error.Should().Be("Something went wrong. Please try again later.");
        }
Exemple #2
0
        public void Should_PassValidation_When_GivenValidUserAccountAndPasswordSalt()
        {
            // Arrange
            var userAccount  = new UserAccount(username: "******", password: "******", isActive: false, isFirstTimeUser: true, roleType: "public");
            var passwordSalt = new PasswordSalt(salt: "@$!@#a2131asda@#!");
            var createFirstTimeSsoUserPostLogicValidationStrategy = new CreateFirstTimeSsoUserPostLogicValidationStrategy(userAccount, passwordSalt);

            // Act
            var result = createFirstTimeSsoUserPostLogicValidationStrategy.ExecuteStrategy();

            // Assert
            result.Data.Should().BeTrue();
            result.Error.Should().BeNull();
        }