Exemple #1
0
        public void L33tTest()
        {
            var l = new Zxcvbn.Matcher.L33tMatcher(new Zxcvbn.Matcher.DictionaryMatcher("test", new List <string> {
                "password"
            }));

            l.MatchPassword("password");
            l.MatchPassword("p@ssword");
            l.MatchPassword("p1ssword");
            l.MatchPassword("p1!ssword");
            l.MatchPassword("p1!ssw0rd");
            l.MatchPassword("p1!ssw0rd|");
        }
Exemple #2
0
        public void DictionaryTest()
        {
            var dm = new Zxcvbn.Matcher.DictionaryMatcher("test", "test_dictionary.txt");

            var res = dm.MatchPassword("NotInDictionary");

            Assert.AreEqual(0, res.Count());

            res = dm.MatchPassword("choreography");
            Assert.AreEqual(1, res.Count());

            res = dm.MatchPassword("ChOrEograPHy");
            Assert.AreEqual(1, res.Count());


            var leet = new Zxcvbn.Matcher.L33tMatcher(dm);

            res = leet.MatchPassword("3mu");
            Assert.AreEqual(1, res.Count());

            res = leet.MatchPassword("3mupr4nce|egume");
        }
Exemple #3
0
        public void L33tTest()
        {
            var l = new Zxcvbn.Matcher.L33tMatcher(new Zxcvbn.Matcher.DictionaryMatcher("test", new List<string> {"password"}));

            l.MatchPassword("password");
            l.MatchPassword("p@ssword");
            l.MatchPassword("p1ssword");
            l.MatchPassword("p1!ssword");
            l.MatchPassword("p1!ssw0rd");
            l.MatchPassword("p1!ssw0rd|");
        }
Exemple #4
0
        public void DictionaryTest()
        {
            var dm = new Zxcvbn.Matcher.DictionaryMatcher("test", "test_dictionary.txt");

            var res = dm.MatchPassword("NotInDictionary");
            Assert.AreEqual(0, res.Count());

            res = dm.MatchPassword("choreography");
            Assert.AreEqual(1, res.Count());

            res = dm.MatchPassword("ChOrEograPHy");
            Assert.AreEqual(1, res.Count());

            var leet = new Zxcvbn.Matcher.L33tMatcher(dm);
            res = leet.MatchPassword("3mu");
            Assert.AreEqual(1, res.Count());

            res = leet.MatchPassword("3mupr4nce|egume");
        }