public AssertFirst ( string predicateName, int arity, |
||
predicateName | string | |
arity | int | |
code | ||
Résultat | void |
public void AssertFirst_2() { ArrayList p = new ArrayList(); HaltInstruction hi = new HaltInstruction(); p.Add(hi); AMProgram program = new AMProgram(); program.Initialize(p); program.AssertFirst("male", 1, p); ProgramClause oldFirst = program["male/1"]; program.AssertFirst("male", 1, p); ProgramClause newFirst = program["male/1"]; Assert.AreEqual(newFirst.Name, "male"); Assert.AreEqual(newFirst.Arity, 1); Assert.AreEqual(newFirst.Instruction.Name(), "try_me_else"); Assert.AreEqual(oldFirst.Name, "male%1/1"); Assert.AreEqual(oldFirst.Arity, 1); Assert.AreEqual(oldFirst.Instruction.Name(), "trust_me"); }
public void AssertFirst_3() { ArrayList p = new ArrayList(); HaltInstruction hi = new HaltInstruction(); p.Add(hi); AMProgram program = new AMProgram(); program.Initialize(p); program.AssertFirst("male", 1, p); ProgramClause male3 = program["male/1"]; program.AssertFirst("male", 1, p); ProgramClause male2 = program["male/1"]; program.AssertFirst("male", 1, p); ProgramClause male1 = program["male/1"]; Assert.AreEqual(male1.Name, "male"); Assert.AreEqual(male1.Arity, 1); Assert.AreEqual(male1.Instruction.Name(), "try_me_else"); Assert.AreEqual(male2.Name, "male%1/1"); Assert.AreEqual(male2.Arity, 1); Assert.AreEqual(male2.Instruction.Name(), "retry_me_else"); Assert.AreEqual(male3.Name, "male%2/1"); Assert.AreEqual(male3.Arity, 1); Assert.AreEqual(male3.Instruction.Name(), "trust_me"); }
public void AssertFirst_1() { ArrayList p = new ArrayList(); HaltInstruction hi = new HaltInstruction(); p.Add(hi); AMProgram program = new AMProgram(); program.Initialize(p); program.AssertFirst("male", 1, p); ProgramClause male1 = program["male/1"]; Assert.AreEqual(male1.Name, "male"); Assert.AreEqual(male1.Arity, 1); Assert.AreEqual(male1.Instruction.Name(), "nop"); }