Example #1
0
        public void GetRange_WhenGivenAMinimumAndMaximumValue_ShouldReturnRangeOfIntegersBetweenValues()
        {
            const Int32 initial = 1;
            const Int32 maximum = 10;

            Int32[] values = { 1, 2, 3, 4, 5, 6, 7, 8, 9 };
            Int32[] actual = IntegerHelper.GetRange(initial, maximum).ToArray();

            Assert.That(actual, Is.Not.Empty);
            Assert.That(actual, Is.EqualTo(values));
        }
Example #2
0
        public void GetRange_WhenGivenStartAndMaximumValueWithConditions_ShouldReturnRangeOfIntegersMatchingThoseConditions()
        {
            const Int32 initial = 1;
            const Int32 maximum = 10;

            Int32[] values = { 3, 5, 6, 9 };
            Func <Int32, Boolean>[] conditions = { IntegerHelper.IsMultipleOfThree, IntegerHelper.IsMultipleOfFive };

            Int32[] actual = IntegerHelper.GetRange(initial, maximum, conditions).ToArray();

            Assert.That(actual, Is.Not.Empty);
            Assert.That(actual, Is.EqualTo(values));
        }