Example #1
0
        public void All_solutions_same()
        {
            var logins      = PasscodeDerivation.KeyLog.Lines();
            var edSolution  = PasscodeDerivation.ShortestPhrase(logins).ToString();
            var kevSolution = Week1.Computeaverage(logins);
            var leeSolution = LeeSolution.Compute(logins);

            Assert.AreEqual(edSolution, kevSolution);
            Assert.AreEqual(edSolution, leeSolution);
        }
Example #2
0
        public void Kev_speed_of_alogithm()
        {
            var logins = PasscodeDerivation.KeyLog.Lines();

            StatsCollection result = LinqPadUX.Measure.Action(() => Week1.Computeaverage(logins));

            var builder = new StringBuilder();

            result.WriteReportTable(new StringWriter(builder), 1f);

            var temporaryFile = FileUtility.GetTemporaryFile(".html");

            File.WriteAllText(temporaryFile, builder.ToString());
            System.Diagnostics.Process.Start(temporaryFile);
            //File.Delete(temporaryFile);
        }