Exemplo n.º 1
0
        public void Visio2003ImplicationProperties_2_3()
        {
            int totalTest = 0;

            using(Visio2003Adapter va = new Visio2003Adapter(ruleFilesFolder + "test-2_3.vdx", FileAccess.Read)) {
                foreach(Implication i in va.Implications) {
                    if (i.Label == "imp1") {
                        Assert.AreEqual(70, i.Priority, "imp1: Priority");
                        Assert.AreEqual("imp2", i.Mutex, "imp1: Mutex");
                        Assert.AreEqual("imp3", i.Precondition, "imp1: Precondition");
                        Assert.AreEqual(ImplicationAction.Assert, i.Action, "imp1: Asserting");
                        Assert.IsTrue(i.Deduction.HasFormula, "imp1: HasFormula");
                    }
                    else if (i.Label == "imp2") {
                        Assert.AreEqual(20, i.Priority, "imp2: Priority");
                        Assert.AreEqual("imp1", i.Mutex, "imp2: Mutex");
                        Assert.AreEqual("imp3", i.Precondition, "imp2: Precondition");
                        Assert.AreEqual(ImplicationAction.Retract, i.Action, "imp2: Retract");
                    }
                    else if (i.Label == "imp3") {
                        Assert.AreEqual(50, i.Priority, "imp3: Priority");
                        Assert.AreEqual(String.Empty, i.Mutex, "imp3: Mutex");
                        Assert.AreEqual(String.Empty, i.Precondition, "imp3: Precondition");
                        Assert.AreEqual(ImplicationAction.Assert,i.Action,  "imp3: Assert");
                    }
                    else if (i.Label == "imp4") {
                        Assert.AreEqual(50, i.Priority, "imp4: Priority");
                        Assert.AreEqual(String.Empty, i.Mutex, "imp4: Mutex");
                        Assert.AreEqual(String.Empty,i.Precondition,  "imp4: Precondition");
                        Assert.AreEqual(ImplicationAction.Count, i.Action, "imp4: Count");
                    }
                    else if (i.Label == "imp5") {
                        Assert.AreEqual(50, i.Priority, "imp5: Priority");
                        Assert.AreEqual(String.Empty, i.Mutex, "imp5: Mutex");
                        Assert.AreEqual(String.Empty, i.Precondition, "imp5: Precondition");
                        Assert.AreEqual(ImplicationAction.Modify, i.Action, "imp4: Modify");
                    }
                    totalTest++;
                }
            }

            Assert.AreEqual(5, totalTest, "totalTest");
        }
Exemplo n.º 2
0
        public void Visio2003ImplicationProperties_2_1()
        {
            int totalTest = 0;

            using(Visio2003Adapter va = new Visio2003Adapter(ruleFilesFolder + "test-2_1.vdx", FileAccess.Read)) {
                foreach(Implication i in va.Implications) {
                    if (i.Label == "imp1") {
                        Assert.AreEqual(70, i.Priority, "imp1: Priority");
                        Assert.AreEqual("imp2", i.Mutex, "imp1: Mutex");
                        Assert.AreEqual("imp3", i.Precondition, "imp1: Precondition");
                        Assert.AreEqual(ImplicationAction.Assert, i.Action, "imp1: Asserting");
                        totalTest++;
                    }
                    else if (i.Label == "imp2") {
                        Assert.AreEqual(20, i.Priority, "imp2: Priority");
                        Assert.AreEqual("imp1", i.Mutex, "imp2: Mutex");
                        Assert.AreEqual("imp3", i.Precondition, "imp2: Precondition");
                        Assert.AreEqual(ImplicationAction.Assert, i.Action, "imp2: Asserting");
                        totalTest++;
                    }
                }
            }

            Assert.AreEqual(2, totalTest, "totalTest");
        }