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); }
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()); }