예제 #1
0
        public void testFiboSequence()
        {
            var seq = Fibonacci.Sequence(8);

            AreEqual(seq[0], 0);
            AreEqual(seq[1], 1);
            AreEqual(seq[2], 1);
            AreEqual(seq[3], 2);
            AreEqual(seq[4], 3);
            AreEqual(seq[5], 5);
            AreEqual(seq[8], 21);
            AreEqual(seq.Length, 9);
        }
예제 #2
0
        public void testFibonacci()
        {
            values    = new BarSpud(values.manager);
            indicator = new Fibonacci((BarSpud)values, 20);

            var testBar1 = bar(1, 1, 1, 1);
            var testBar2 = bar(1, 2, 0, 1);

            addPoint(testBar1, new BreakPoints(testBar1, 1, 1));
            AreEqual(indicator[0].fibo0(), 1);
            AreEqual(indicator[0].fibo38(), 1);
            AreEqual(indicator[0].fibo50(), 1);
            AreEqual(indicator[0].fibo62(), 1);
            AreEqual(indicator[0].fibo100(), 1);
            addPoint(testBar2, new BreakPoints(testBar2, 2, 0));
            AreEqual(indicator[0].fibo0(), 0);
            AreEqual(indicator[0].fibo38(), 0.764);
            AreEqual(indicator[0].fibo50(), 1);
            AreEqual(indicator[0].fibo62(), 1.236);
            AreEqual(indicator[0].fibo100(), 2);
        }