コード例 #1
0
        public void ComputeRecursiveTest()
        {
            BigInteger answer = 0;

            fibClassOnTest = new ComputeFibNumRecursively();
            answer         = fibClassOnTest.ComputeFib(25);
            Assert.AreEqual((UInt64)75025, answer);
        }
コード例 #2
0
        public void IterativeMinTest()
        {
            BigInteger answer = 0;

            fibClassOnTest = new ComputeFibNumIteratively();
            answer         = fibClassOnTest.ComputeFib(0);
            Assert.AreEqual((UInt64)0, answer);
        }
コード例 #3
0
        public void IterativeMaxTest()
        {
            BigInteger answer = 0;

            fibClassOnTest = new ComputeFibNumIteratively();
            answer         = fibClassOnTest.ComputeFib(1476);
            //Actual 1.3069892237633987E+308
            //Displayed 1.3069892237634E+308
            Assert.AreEqual(1.3069892237633987E+308, answer);
        }
コード例 #4
0
 /// <summary>
 /// Public constructor for TimedComp class
 /// </summary>
 /// <param name="comp">IComputeFib instance to compute seq with</param>
 /// <param name="seqNum">Number in Sequence to find</param>
 public TimedComp(IComputeFib comp, int seqNum)
 {
     timedCompute = comp;
     sequenceNum  = seqNum;
 }
コード例 #5
0
 public void InstanciateIterTest()
 {
     fibClassOnTest = new ComputeFibNumIteratively();
     Assert.IsNotNull(fibClassOnTest);
 }