Beispiel #1
0
        public void Fibonachi_Expected_ArgumentOutOfRangeException_If_BorderNumber_0()
        {
            var bigIntegerArray = new BigInteger[11] {
                new BigInteger(1), new BigInteger(1), new BigInteger(2), new BigInteger(3), new BigInteger(5),
                new BigInteger(8), new BigInteger(13), new BigInteger(21), new BigInteger(34), new BigInteger(55), new BigInteger(89)
            };

            var numberBorder = 0;

            Assert.Throws <ArgumentOutOfRangeException>(() => BinarySearchAndNumber.GeneratorFibonachiNumber(numberBorder));
        }
Beispiel #2
0
        public void Fibonachi_Valid_Data()
        {
            var bigIntegerArray = new BigInteger[11] {
                new BigInteger(1), new BigInteger(1), new BigInteger(2), new BigInteger(3), new BigInteger(5),
                new BigInteger(8), new BigInteger(13), new BigInteger(21), new BigInteger(34), new BigInteger(55), new BigInteger(89)
            };

            var numberBorder = 80;

            var index = 0;

            foreach (BigInteger element in BinarySearchAndNumber.GeneratorFibonachiNumber(numberBorder))
            {
                Assert.AreEqual(bigIntegerArray[index++], element);
            }
        }
Beispiel #3
0
        public void Fibonachi_Valid_Data_If_NumberBorder_1()
        {
            var bigIntegerArray = new BigInteger[2] {
                new BigInteger(1), new BigInteger(1)
            };

            var numberBorder = 1;

            var index = 0;

            foreach (BigInteger element in BinarySearchAndNumber.GeneratorFibonachiNumber(numberBorder))
            {
                Assert.AreEqual(bigIntegerArray[index], element);

                index++;
            }
        }