Beispiel #1
0
 public void SampleTest()
 {
     Assert.AreEqual(new int[] { 3, 5 }, FindDivisors.Divisors(15));
     Assert.AreEqual(new int[] { 2, 4, 8 }, FindDivisors.Divisors(16));
     Assert.AreEqual(new int[] { 11, 23 }, FindDivisors.Divisors(253));
     Assert.AreEqual(new int[] { 2, 3, 4, 6, 8, 12 }, FindDivisors.Divisors(24));
 }
Beispiel #2
0
 public void HeavyRandomTests()
 {
     for (int i = 0; i < 1000; ++i)
     {
         int   test     = int.MaxValue - rnd.Next(2, 100001);
         int[] expected = solution(test);
         int[] actual   = FindDivisors.Divisors(test);
         Assert.AreEqual(expected, actual);
     }
 }