Ejemplo n.º 1
0
        public void RepeatMatcher()
        {
            var repeat = new Zxcvbn.Matcher.RepeatMatcher();

            var res = repeat.MatchPassword("aaasdffff");

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

            var m1 = res.ElementAt(0);

            Assert.AreEqual(0, m1.i);
            Assert.AreEqual(2, m1.j);
            Assert.AreEqual("aaa", m1.Token);

            var m2 = res.ElementAt(1);

            Assert.AreEqual(5, m2.i);
            Assert.AreEqual(8, m2.j);
            Assert.AreEqual("ffff", m2.Token);


            res = repeat.MatchPassword("asdf");
            Assert.AreEqual(0, res.Count());
        }
Ejemplo n.º 2
0
        public void RepeatMatcher()
        {
            var repeat = new Zxcvbn.Matcher.RepeatMatcher();

            var res = repeat.MatchPassword("aaasdffff");
            Assert.AreEqual(2, res.Count());

            var m1 = res.ElementAt(0);
            Assert.AreEqual(0, m1.i);
            Assert.AreEqual(2, m1.j);
            Assert.AreEqual("aaa", m1.Token);

            var m2 = res.ElementAt(1);
            Assert.AreEqual(5, m2.i);
            Assert.AreEqual(8, m2.j);
            Assert.AreEqual("ffff", m2.Token);

            res = repeat.MatchPassword("asdf");
            Assert.AreEqual(0, res.Count());
        }