public void MyQuickSortTestClassOneArray_Equals_ExpectedSortedByIdArray()
        {
            TestClassOne[] arr      = TestClassOneService.GenerateTestClassOnesArray();
            TestClassOne[] expected = arr.OrderBy(t => t.Id).ToArray();

            TestClassOne[] actual = arr.QuickSortBy(t => t.Id);

            Assert.Equal(expected, actual);
        }
Пример #2
0
        public void MyMergeSortTestClassOneArray_Equals_ExpectedSortedByDateArray()
        {
            TestClassOne[] arr      = TestClassOneService.GenerateTestClassOnesArray();
            TestClassOne[] expected = arr.OrderBy(t => t.Date).ToArray();

            TestClassOne[] actual = arr.MergeSortBy(t => t.Date);

            Assert.Equal(expected, actual);
        }
Пример #3
0
        public void MergeSortCall_Throws_ArgumentException()
        {
            TestClassOne[] arr = TestClassOneService.GenerateTestClassOnesArray();

            Assert.Throws <ArgumentException>(() => arr.MergeSort());
        }
        public void MergeSortCall_Throws_ArgumentException()
        {
            TestClassOne[] arr = TestClassOneService.GenerateTestClassOnesArray();

            Assert.Throws <ArgumentException>(() => arr.CustomBinarySearch(arr.First()));
        }