Ejemplo n.º 1
0
 public void Test1()
 {
     Console.WriteLine("****** Basic Tests");
     Assert.AreEqual(3, pb.Persistence(39));
     Assert.AreEqual(0, pb.Persistence(4));
     Assert.AreEqual(2, pb.Persistence(25));
     Assert.AreEqual(4, pb.Persistence(999));
 }
Ejemplo n.º 2
0
 public void PersistentBugger_Persistence_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));
 }
Ejemplo n.º 3
0
        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));
            }
        }
Ejemplo n.º 4
0
 public void ShouldReturnTheCorrectCountOfDigitsThatMustBeMultipliedToReachLessThanTwoDigits(long value,
                                                                                             int expected)
 {
     Assert.Equal(expected, PersistentBugger.Persistence(value));
 }