Example #1
0
        public void LongPassword()
        {
            String excessivelyLongPassword = "******";

            ZxcvbnInstance zxcvbn = new ZxcvbnInstance();

            zxcvbn.Score(excessivelyLongPassword);
        }
Example #2
0
        public void CrackTimeReasonablePassword()
        {
            ZxcvbnInstance zxcvbn = new ZxcvbnInstance();

            var          actual   = zxcvbn.crack_time(ReasonablePassword);
            const double expected = 2.442553556268167E+32;

            Assert.AreEqual(expected, actual, "actual: " + actual);
        }
Example #3
0
        public void PasswordTooLong()
        {
            const int maxLength = 4096;
            String    excessivelyLongPassword = new string('x', maxLength + 1);

            ZxcvbnInstance zxcvbn = new ZxcvbnInstance();

            zxcvbn.Score(excessivelyLongPassword);
        }
Example #4
0
        public void CrackTimeBasic()
        {
            ZxcvbnInstance zxcvbn = new ZxcvbnInstance();

            var          actual   = zxcvbn.crack_time(LamePassword);
            const double expected = 0.003;

            Assert.AreEqual(expected, actual);
        }
Example #5
0
        public void EntropyBasic()
        {
            ZxcvbnInstance zxcvbn = new ZxcvbnInstance();

            var          actual   = zxcvbn.Entropy(LamePassword);
            const double expected = 6.0;

            Assert.AreEqual(expected, actual);
        }
Example #6
0
        public void ScoreIsZeroWithLamePassword()
        {
            ZxcvbnInstance zxcvbn = new ZxcvbnInstance();

            const int zero   = 0;
            int       actual = zxcvbn.Score(LamePassword);

            Assert.AreEqual(zero, actual);
        }
Example #7
0
        public void JurassicJS_HelloCode()
        {
            ZxcvbnInstance zxcvbn = new ZxcvbnInstance();

            zxcvbn.Engine.SetGlobalValue("GlobalVariable", LamePassword);
            string actual = zxcvbn.Engine.GetGlobalValue <string>("GlobalVariable");

            Assert.AreEqual(LamePassword, actual);
        }
        public void CrackTimeReasonablePassword()
        {
            ZxcvbnInstance zxcvbn = new ZxcvbnInstance();

            int       actual   = zxcvbn.crack_time(ReasonablePassword);
            const int expected = 0;

            Assert.AreEqual(expected, actual, "actual: " + actual);
        }
Example #9
0
        // [TestMethod]

        public void PasswordTooLongx()
        {
            const int maxLength = 4096;
            String    excessivelyLongPassword = new string('x', maxLength - 1);

            ZxcvbnInstance zxcvbn = new ZxcvbnInstance();
            var            q      = zxcvbn.calculation_time(excessivelyLongPassword);

            Assert.IsTrue(false, "Score: " + q);
        }