예제 #1
0
        public void TestPasswd()
        {
            IPassword p1 = new ahbsd.lib.Password.Password("Unsicher");

            p1.OnChange += P1_OnChange;

            p1.Value = "B<eSs3r üBe9R ©6&/|\\\"";
        }
예제 #2
0
        public void TestPasswdVars(string passwd, ushort security)
        {
            IPassword password = new ahbsd.lib.Password.Password();

            password.OnChange += Password_OnChange;
            password.Value     = passwd;
            Console.WriteLine($"Security: {password.SecurityValue}: Value = {password.SecurityValue.Security} [{password.SecurityValue.Security} >= {security} = {password.SecurityValue.Security >= security}]");
            Assert.True(password.SecurityValue.Security >= security);
        }
        public void CharacteristicDictionaryTest1(string text, bool expectedNumeric, bool expectedLower, bool expectedCapital, bool expectedSpecial, bool expectedSpace)
        {
            ICharacteristicDictionary dict1;
            IPassword password = new ahbsd.lib.Password.Password(text);

            dict1 = password.Characteristics;

            Assert.Equal(expectedNumeric, dict1[Charasteristic.Numeric]);
            Assert.Equal(expectedLower, dict1[Charasteristic.LowercaseLetter]);
            Assert.Equal(expectedCapital, dict1[Charasteristic.CapitalLetter]);
            Assert.Equal(expectedSpecial, dict1[Charasteristic.SpecialCharacter]);
            Assert.Equal(expectedSpace, dict1[Charasteristic.Space]);
        }