public override void Define() { NameFact thisNameFact = null; NameFact otherNameFact = null; ReferenceFact referenceFact = null; When() .Match(() => thisNameFact, f => f.Name == "ThisName") .Match(() => otherNameFact, f => f.Name == "OtherName") .Match(() => referenceFact, rf => rf.Reference == otherNameFact); Then() .Do(ctx => ctx.NoOp()); }
public void Fire_FourthRuleMatchesFacts_OnlyMatchingRuleFires() { //Arrange var thisNameFact = new NameFact { Name = "ThisName" }; var otherNameFact = new NameFact { Name = "OtherName" }; var referenceFact = new ReferenceFact { Reference = otherNameFact }; Session.Insert(thisNameFact); Session.Insert(otherNameFact); Session.Insert(referenceFact); //Act Session.Fire(); //Assert AssertDidNotFire <TestRule3>(); AssertFiredOnce <TestRule4>(); }