Example #1
0
        public void FilterDigitByDivision_executes_successfully_on_big_array(int digit)
        {
            int[] array = CreateBigArray();

            (int[] numbers, TimeSpan time)result =
                AlgorithmVariants.FilterDigitByDivision(digit, array);

            TestContext.WriteLine($"Execution time: {result.time.Milliseconds}");

            Assert.IsTrue(IsExpectedArray(digit, result.numbers));
        }
Example #2
0
        public void ValidateArray_throws_exception_if_null_argument_was_passed(
            int number,
            params int[] array)
        {
            Assert.That(
                () => AlgorithmVariants.FilterDigitByDivision(number, array),
                Throws.TypeOf <ArgumentOutOfRangeException>());

            Assert.That(
                () => AlgorithmVariants.FilterDigitByArrays(number, array),
                Throws.TypeOf <ArgumentOutOfRangeException>());
        }
Example #3
0
        public void ValidateDigit_throws_exception_when_number_is_out_of_the_range(
            int number,
            params int[] array)
        {
            Assert.That(
                () => AlgorithmVariants.FilterDigitByDivision(number, array),
                Throws.TypeOf <ArgumentOutOfRangeException>());

            Assert.That(
                () => AlgorithmVariants.FilterDigitByArrays(number, array),
                Throws.TypeOf <ArgumentOutOfRangeException>());
        }