Пример #1
0
        public void ArrayMergeSortedInline1CompleteTestEmptyListList1()
        {
            var a = new int[1];
            var b = new[] { 3 };

            ArrayMergeSortedInline1Complete.Merge(a, 0, b);

            var aExpected = new[] { 3 };

            CollectionAssert.AreEqual(aExpected, a);
        }
Пример #2
0
        public void ArrayMergeSortedInline1CompleteTestTwoElementsReversed()
        {
            var a = new[] { 7, 0 };
            var b = new[] { 3 };

            ArrayMergeSortedInline1Complete.Merge(a, 1, b);

            var aExpected = new[] { 3, 7 };

            CollectionAssert.AreEqual(aExpected, a);
        }
Пример #3
0
        public void ArrayMergeSortedInline1CompleteTestOdd()
        {
            var a = new[] { 3, 7, 23, 56, 0, 0, 0 };
            var b = new[] { 5, 7, 8 };

            ArrayMergeSortedInline1Complete.Merge(a, 4, b);

            var aExpected = new[] { 3, 5, 7, 7, 8, 23, 56 };

            CollectionAssert.AreEqual(aExpected, a);
        }
Пример #4
0
 public void ArrayMergeSortedInline1CompleteTestNullArrays()
 {
     try
     {
         ArrayMergeSortedInline1Complete.Merge(null, 0, null);
     }
     catch (ArgumentException)
     {
         Assert.IsTrue(true);
         return;
     }
     Assert.Fail();
 }
Пример #5
0
 public void ArrayMergeSortedInline1CompleteTestNullListList2()
 {
     try
     {
         var a = new int[0];
         ArrayMergeSortedInline1Complete.Merge(a, 0, null);
     }
     catch (ArgumentException)
     {
         Assert.IsTrue(true);
         return;
     }
     Assert.Fail();
 }
Пример #6
0
 public void ArrayMergeSortedInline1CompleteTestNegativeCount()
 {
     try
     {
         var a = new[] { 3, 7, 23, 56, 0, 0, 0, 0 };
         var b = new[] { 5, 7, 8, 38 };
         ArrayMergeSortedInline1Complete.Merge(a, -2, b);
     }
     catch (ArgumentException)
     {
         Assert.IsTrue(true);
         return;
     }
     Assert.Fail();
 }