[Test] public void TestMethodCacheNever() { IBELObject p = new Dummy(); ExecutionContext ctx = new ExecutionContext(); IBELObject v1 = p.ValueOf("NumberNever", null, ctx); Assert.IsTrue(FindRule(ctx, typeof(CacheRuleNever))); }
[Test] public void TestVarArgsExtract() { IBELObject p = new Dummy(); ExecutionContext ctx = new ExecutionContext(); StringPTN s1 = new StringPTN(@"string1"); StringPTN s2 = new StringPTN(@"string2"); ArrayList args = new ArrayList(); args.Add(new IntegerPTN("1")); args.Add(s1); args.Add(s2); IBELObject v = p.ValueOf("ExtractExtraArg", args, ctx); IOutputSequence seq = v.ToOutputSequence(); Assert.AreEqual("P(string2)", OutputSequenceToString(seq)); }
[Test] public void TestVarArgsZero() { IBELObject p = new Dummy(); ExecutionContext ctx = new ExecutionContext(); StringPTN s1 = new StringPTN(new BELLocation(ContextString, 1, 1), @"string1"); StringPTN s2 = new StringPTN(new BELLocation(ContextString, 1, 1), @"string2"); ArrayList args = new ArrayList(); args.Add(s1); args.Add(s2); IBELObject v = p.ValueOf("ArgCounterZero", args, ctx); IOutputSequence seq = v.ToOutputSequence(); Assert.AreEqual("P(2)", OutputSequenceToString(seq)); }