Exemple #1
0
        public override bool GetValue()
        {
            If  leftToRight = new If(Left, Right);
            If  rightToLeft = new If(Right, Left);
            And both        = new And(leftToRight, rightToLeft);

            return(both.GetValue());
        }
Exemple #2
0
        public void testAnd_StringInput()
        {
            DynamoModel model        = Controller.DynamoModel;
            string      testFilePath = Path.Combine(logicTestFolder, "testAndStringInput.dyn");

            model.Open(testFilePath);
            dynSettings.Controller.RunExpression(null);
            And watch1 = model.CurrentWorkspace.NodeFromWorkspace <And>("9d18c5d9-7678-4818-b4f6-474c29c358ff");
            And watch2 = model.CurrentWorkspace.NodeFromWorkspace <And>("2e685247-b78a-4f0d-8e43-57ca740857c8");

            String actualResult1   = watch1.GetValue(0).GetStringFromFSchemeValue();
            String actualResult2   = watch2.GetValue(0).GetStringFromFSchemeValue();
            String expectedResult1 = "b";
            String expectedResult2 = "a";

            Assert.AreEqual(expectedResult1, actualResult1);
            Assert.AreEqual(expectedResult2, actualResult2);
        }
Exemple #3
0
        public void testAnd_NumberInput()
        {
            DynamoModel model        = Controller.DynamoModel;
            string      testFilePath = Path.Combine(logicTestFolder, "testAndNumberInput.dyn");

            model.Open(testFilePath);
            dynSettings.Controller.RunExpression(null);
            And watch1 = model.CurrentWorkspace.NodeFromWorkspace <And>("24a185da-6176-4b08-bba3-214ccc379dc7");
            And watch2 = model.CurrentWorkspace.NodeFromWorkspace <And>("1db98a6e-0fde-4911-9da5-800dc820fab3");
            And watch3 = model.CurrentWorkspace.NodeFromWorkspace <And>("be726ccd-686c-40d9-a9fa-ed4990434906");

            double actualResult1   = watch1.GetValue(0).GetDoubleFromFSchemeValue();
            double actualResult2   = watch2.GetValue(0).GetDoubleFromFSchemeValue();
            double actualResult3   = watch3.GetValue(0).GetDoubleFromFSchemeValue();
            double expectedResult1 = 0;
            double expectedResult2 = 1;
            double expectedResult3 = 0;

            Assert.AreEqual(expectedResult1, actualResult1);
            Assert.AreEqual(expectedResult2, actualResult2);
            Assert.AreEqual(expectedResult3, actualResult3);
        }