Ejemplo n.º 1
0
        public void SampleTest()
        {
            Assert.AreEqual(new int[] { 0, 1, 2 },
                            EnumerableMagic25TakeFirstNElements.Take(new int[] { 0, 1, 2, 3, 5, 8, 13 }, 3));

            Assert.AreEqual(new int[] { },
                            EnumerableMagic25TakeFirstNElements.Take(new int[] { 0, 1, 2, 3, 5, 8, 13 }, 0));
            Assert.AreEqual(new int[] { }, EnumerableMagic25TakeFirstNElements.Take(new int[] { }, 3));
        }
Ejemplo n.º 2
0
 public void RandomTests2()
 {
     for (var i = 0; i < 200; i++)
     {
         var randomArray = RandomArray();
         var n           = Rand.Next(15, 100);
         var expected    = Solution(randomArray, n);
         var message     = FailureMessage(randomArray, expected, n);
         var actual      = EnumerableMagic25TakeFirstNElements.Take(randomArray, n);
         // Console.WriteLine(message);
         Assert.AreEqual(expected, actual, message);
     }
 }