public void Test1()
 {
     Console.WriteLine("****** Basic Tests");
     Assert.AreEqual(3, PersistentBugger.Persistence(39));
     Assert.AreEqual(0, PersistentBugger.Persistence(4));
     Assert.AreEqual(2, PersistentBugger.Persistence(25));
     Assert.AreEqual(4, PersistentBugger.Persistence(999));
 }
        public static void PersistentBugger_Persistence_Random()
        {
            Console.WriteLine("\n 100 Random Tests ****************");
            Random rnd = new Random();

            for (int i = 0; i < 100; i++)
            {
                int n = rnd.Next(10, 500000);
                //Console.WriteLine("Numbers: n " + n);
                Assert.AreEqual(Sol(n), PersistentBugger.Persistence(n));
            }
        }
Exemple #3
0
 public void ShouldReturnTheCorrectCountOfDigitsThatMustBeMultipliedToReachLessThanTwoDigits(long value,
                                                                                             int expected)
 {
     Assert.Equal(expected, PersistentBugger.Persistence(value));
 }