コード例 #1
0
        public void IsUsernameValid_UsernameShouldNotBeNull()
        {
            // Arrange
            bool expected = false;

            // Act
            bool actual = AuthServiceImpl.IsUsernameValid(null);

            // Assert
            Assert.Equal(expected, actual);
        }
コード例 #2
0
        public void IsUsernameValid_UsernameShouldNotHaveSpacesWithin()
        {
            // Arrange
            bool   expected    = false;
            string wrongString = "joaquin garcia";

            // Act
            bool actual = AuthServiceImpl.IsUsernameValid(wrongString);

            // Assert
            Assert.Equal(expected, actual);
        }
コード例 #3
0
        public void IsUsernameValid_UsernameSizeShouldNotBeMoreThan20Characters()
        {
            // Arrange
            bool   expected           = false;
            string tooLongDescription = new string('A', 21);

            // Act
            bool actual = AuthServiceImpl.IsUsernameValid(tooLongDescription);

            // Assert
            Assert.Equal(expected, actual);
        }
コード例 #4
0
        public void IsUsernameValid_UsernameSizeShouldNotBeLessThan6Characters()
        {
            // Arrange
            bool   expected       = false;
            string tooShortString = new string('A', 5);

            // Act
            bool actual = AuthServiceImpl.IsUsernameValid(tooShortString);

            // Assert
            Assert.Equal(expected, actual);
        }