Exemple #1
0
 private void TestA_ThrowNullException(SorterBase sorter)
 {
     try
     {
         sorter.Sort(null);
         Assert.IsEmpty("Should throw ArgumentNullException");
     }
     catch (Exception ex)
     {
         Assert.IsInstanceOf <ArgumentNullException>(ex);
     }
 }
Exemple #2
0
        private void TestA_Sort(SorterBase sorter, int[] input)
        {
            var expected = input.Clone() as int[];

            Array.Sort(expected);

            sorter.Sort(input);
            var inputString = JsonConvert.SerializeObject(input);

            Console.WriteLine($"input: {inputString}");

            var expectedString = JsonConvert.SerializeObject(expected);

            Console.WriteLine($"expected: {expectedString}");

            Assert.AreEqual(expectedString, inputString);
        }