Example #1
0
        public void FactBaseAssertRetract()
        {
            FactBase fb = new FactBase();

            Assert.IsTrue(fb.Assert(new Fact("spending",
                            new Individual("Peter Miller"),
                            new Individual("min(5000,EUR)"),
                            new Individual("previous year"))), "Assert 'P.Miller Spending'");

            Assert.IsTrue(fb.Assert(new Fact("JQD Spending",
                               "spending",
                            new Individual("John Q.Clone Doe"),
                            new Individual("min(7000,EUR)"),
                            new Individual("previous year"))), "Assert 'JQD Spending'");

            Assert.IsNotNull(fb.GetFact("JQD Spending"), "Exist 'JQD Spending'");

            Assert.IsFalse(fb.Assert(fact3bis), "Assert fact3bis");
            Assert.IsTrue(fb.Assert(factX), "Assert factX");
            fb.Retract(fb.GetFact("JQD Spending"));
            Assert.IsNull(fb.GetFact("JQD Spending"), "Retract 'JQD Spending'");
        }