예제 #1
0
        public void IncludeUpperCase_Should_ReturnExpectedPassword()
        {
            // Arrange
            var expected  = @"NDYBGCRV";
            var generator = new PasswordGenerator(123);

            generator.DisableAll();

            // Act
            generator.IncludeUpperCase = true;
            var password = generator.Generate(8);

            // Assert
            Assert.Equal(expected, password);
        }
예제 #2
0
        public void IncludeExtended_Should_ReturnExpectedPassword()
        {
            // Arrange
            var expected  = @"{;:;\\\?";
            var generator = new PasswordGenerator(123);

            generator.DisableAll();

            // Act
            generator.IncludeExtended = true;
            var password = generator.Generate(8);

            // Assert
            Assert.Equal(expected, password);
        }
예제 #3
0
        public void IncludeSymbols_Should_ReturnExpectedPassword()
        {
            // Arrange
            var expected  = @"+!=#^*!!";
            var generator = new PasswordGenerator(123);

            generator.DisableAll();

            // Act
            generator.IncludeSymbols = true;
            var password = generator.Generate(8);

            // Assert
            Assert.Equal(expected, password);
        }
예제 #4
0
        public void IncludeAll_Should_ReturnExpectedPassword()
        {
            // Arrange
            var expected  = @"C:5tFe\w?j}cMyY.&0IHvONDEl8s,r+4*%TX6Kx>LBQqdk3;uW";
            var generator = new PasswordGenerator(123);

            generator.DisableAll();

            // Act
            generator.IncludeAll();
            var password = generator.Generate(50);

            // Assert
            Assert.Equal(expected, password);
        }
예제 #5
0
        public void ProhibitRepeatingCharacters_Should_ReturnExpectedPassword()
        {
            // Arrange
            var expected  = @"{;:\?<}.";
            var generator = new PasswordGenerator(123);

            generator.DisableAll();

            // Act
            generator.IncludeExtended             = true;
            generator.ProhibitRepeatingCharacters = true;
            var password = generator.Generate(8);

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