예제 #1
0
        public void DoGapTestWithNull()
        {
            var gap           = 6;
            var initialNumber = 100;
            var finalNumber   = 110;

            var gapInPrimes = new GapInPrimes();
            var result      = gapInPrimes.DoGap(gap, initialNumber, finalNumber);

            Assert.AreEqual(null, result, "Incorrect");
        }
예제 #2
0
        public void DoGapTest()
        {
            var gap           = 2;
            var initialNumber = 100;
            var finalNumber   = 110;

            var gapInPrimes = new GapInPrimes();
            var result      = gapInPrimes.DoGap(gap, initialNumber, finalNumber);

            Assert.IsTrue(new long[] { 101, 103 }.SequenceEqual(result), "Incorrect");
        }
예제 #3
0
        public void DoGapLongTest()
        {
            var gap           = 8;
            var initialNumber = (long)3e6;
            var finalNumber   = (long)4e6;

            var gapInPrimes = new GapInPrimes();
            var result      = gapInPrimes.DoGap(gap, initialNumber, finalNumber);


            Assert.IsTrue(new long[] { 3000953, 3000961 }.SequenceEqual(result), "Incorrect");
        }