コード例 #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>();
        }
コード例 #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();
        }
コード例 #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>();
        }
コード例 #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>();
        }