Beispiel #1
0
        public void GenVigenere()
        {
            var poly = GenPoly.GenVigenere("n", "abcdefghijklmnopqrstuvwxyz");

            Assert.AreEqual(1, poly.Length);

            Assert.AreEqual(26, poly[0].Length);

            Assert.AreEqual("n", poly[0][0]);
        }
Beispiel #2
0
        public void HashTest()
        {
            var i = 0;
            while ( i++ < 7000)
            {
                // Verify that the hash generated is not zero.
                var password = RandomGen.RName(30);
                var test = GenPoly.GenPasswordHash(password);
                Assert.IsFalse(test == 0);

                // and verify that the hash generated is repeatable.
                Assert.AreEqual(test, GenPoly.GenPasswordHash(password));
            }
        }
Beispiel #3
0
        public void GenRandomAlpha()
        {
            const string alphabet = "AaBbCcDd";
            var poly = GenPoly.GenRandom(string.Empty, alphabet, 1);

            //Assert.AreNotEqual(0, hash);
            Assert.AreEqual(1, poly.Length); // 1 Alphabet
            Assert.AreEqual(alphabet.Length, poly[0].Length); // With 8 characters

            var result = string.Join("", poly[0]);

            Console.WriteLine("{0} {1}", alphabet, result);

            Assert.IsFalse(alphabet.Equals(result));
        }