Exemple #1
0
        public void MinSortDesc_pass_tests_successfully(
            [ValueSource(nameof(SourceMaxMin))] int[][] initial,
            [ValueSource(nameof(ResultMinDesc))] int[][] result)
        {
            BubbleSort_delegate.Sort(initial, new MinSortDesc());

            CollectionAssert.AreEqual(initial, result);
        }
Exemple #2
0
        public void SumSortAsc_pass_tests_successfully(
            [ValueSource(nameof(SourceSum))] int[][] initial,
            [ValueSource(nameof(ResultSumAsc))] int[][] result)
        {
            BubbleSort_delegate.Sort(initial, new SumSortAsc());

            CollectionAssert.AreEqual(initial, result);
        }
Exemple #3
0
        public void ValidateComparison_Method_Throws_ArgumentNullException_If_Comparison_Is_Null()
        {
            var array = new int[1][];

            Assert.That(
                () => BubbleSort_delegate.Sort(array, comparison: null),
                Throws.TypeOf <ArgumentNullException>());
        }
Exemple #4
0
        public void ValidateArray_Method_Throws_ArgumentException_If_Array_Is_Empty()
        {
            var array = new int[0][];

            Assert.That(
                () => BubbleSort_delegate.Sort(array, comparer: null),
                Throws.TypeOf <ArgumentException>());
        }
Exemple #5
0
        public void ValidateArray_Method_Throws_ArgumentNullException_If_Array_Is_Null()
        {
            var maxAsc = new MaxSortAsc();

            Assert.That(
                () => BubbleSort_delegate.Sort(null, new Comparison <int[]>(maxAsc.Compare)),
                Throws.TypeOf <ArgumentNullException>());
        }