Exemplo n.º 1
0
        public void TestGetVariableInfo()
        {
            if (ControlFlow.Initialize())
            {
                // unittest-controlgetvarinfo
                string[] delimiters  = ControlFlow.GetDelimiters();
                string[] results     = ControlFlow.ControlDirect("x+y", "x" + delimiters[1] + "2" + delimiters[1] + "4" + delimiters[0] + "y" + delimiters[1] + "3" + delimiters[1] + "5");
                string   targetRange = "[5, 9]";

                Assert.AreEqual(targetRange, results[0]);

                string[,] varInfo = ControlFlow.GetVariableInfo();

                Assert.AreEqual(6, varInfo.Length);

                Assert.AreEqual("x", varInfo[0, 0]);
                Assert.AreEqual("2", varInfo[0, 1]);
                Assert.AreEqual("4", varInfo[0, 2]);

                Assert.AreEqual("y", varInfo[1, 0]);
                Assert.AreEqual("3", varInfo[1, 1]);
                Assert.AreEqual("5", varInfo[1, 2]);
            }
            else
            {
                Assert.Fail();
            }
        }