예제 #1
0
        public void testFunctionalityOfPythonRuleItem()
        {
            ruleItem_script testItem = new ruleItem_script(Properties.Settings.Default.testDataPath + filename);
            testItem.pinInfo["myInputPin"].value.data = false;
            testItem.evaluate();
            Assert.IsTrue((testItem.pinInfo["myOutputPin"].value.asBoolean()) == false);

            testItem.pinInfo["myInputPin"].value.data = true;
            testItem.evaluate();
            Assert.IsTrue((testItem.pinInfo["myOutputPin"].value.asBoolean()) == true);
        }
예제 #2
0
        public void testFunctionalityOfPythonRuleItemWithParameters()
        {
            ruleItem_script testItem = new ruleItem_script(Properties.Settings.Default.testDataPath + filenameParameters);

            testItem.parameters["clampToZero"] = "NO U";

            testItem.pinInfo["myInputPin"].value.data = true;
            testItem.evaluate();
            Assert.IsTrue(testItem.pinInfo["myOutputPin"].value.asBoolean());

            testItem.parameters["clampToZero"] = "yes";
            testItem.evaluate();
            Assert.IsFalse(testItem.pinInfo["myOutputPin"].value.asBoolean());
        }