Exemplo n.º 1
0
        public void Password_WrongStyle_Validation(string password)
        {
            // Arrange
            var authValidator = new AuthorizationDataValidator();
            var exception     = default(Exception);

            //Act
            try
            {
                authValidator.ValidatePassword(password);
            }
            catch (Exception e)
            {
                exception = e;
            }

            //Assert
            exception.Should().BeOfType <InvalidDataException>();
        }
Exemplo n.º 2
0
        public void UserName_Pass_Validation(string userName)
        {
            // Arrange
            var authValidator = new AuthorizationDataValidator();
            var exception     = default(Exception);

            //Act
            try
            {
                authValidator.ValidateLogin(userName);
            }
            catch (Exception e)
            {
                exception = e;
            }

            //Assert
            exception.Should().BeNull();
        }
Exemplo n.º 3
0
        public void UserName_Null_Check()
        {
            // Arrange
            var authValidator = new AuthorizationDataValidator();
            var exception     = default(Exception);

            //Act
            try
            {
                authValidator.ValidateLogin(null);
            }
            catch (Exception e)
            {
                exception = e;
            }

            //Assert
            exception.Should().BeOfType <ArgumentNullException>();
        }
Exemplo n.º 4
0
        public void UserName_WrongStyle_Validation(string userName)
        {
            // Arrange
            var authValidator = new AuthorizationDataValidator();
            var exception     = default(Exception);

            //Act
            try
            {
                authValidator.ValidateLogin(userName);
            }
            catch (Exception e)
            {
                exception = e;
            }

            //Assert
            exception.Should().BeOfType <InvalidDataException>();
        }