Beispiel #1
0
        public void Test_DynamicProperty_Regist_Fail_Duplicate()
        {
            var kb = new KB((Name)"Me");

            Assert.Throws <ArgumentException>(
                () => kb.RegistDynamicProperty((Name)"Count", DummyCount));
        }
        public void Test_OperatorRegist_Fail_Duplicate()
        {
            var kb = new KB((Name)"Me");

            Assert.Throws <ArgumentException>(
                () => kb.RegistDynamicProperty((Name)"Count([y])", ((kb1, pers, args, constraints) => null), null));
        }
Beispiel #3
0
        public void Test_Tell_Fail_DynamicProperty_Regist()
        {
            var kb = new KB((Name)"Me");

            Assert.Throws <ArgumentException>(() =>
            {
                kb.RegistDynamicProperty((Name)"Count", DummyCount);
                kb.Tell((Name)"Count(John)", Name.BuildName(3));
            });
        }
        public void Test_Tell_Fail_OperatorRegist()
        {
            var kb = new KB((Name)"Me");

            Assert.Throws <ArgumentException>(() =>
            {
                kb.RegistDynamicProperty((Name)"Count([x])", ((kb1, p, args, constraints) => null), null);
                kb.Tell((Name)"Count(John)", 3);
            });
        }
Beispiel #5
0
        public void Test_DynamicProperty_Regist_Fail_ConstantProperties()
        {
            var kb = new KB((Name)"Me");

            Assert.Throws <ArgumentException>(() =>
            {
                kb.Tell((Name)"CountSubs(John)", Name.BuildName(3));
                kb.RegistDynamicProperty((Name)"CountSubs", "", DummyCount);
            });
        }
Beispiel #6
0
        public void Test_DynamicProperty_Regist_Fail_Null_Surogate()
        {
            var kb = new KB((Name)"Me");

            Assert.Throws <ArgumentNullException>(() => kb.RegistDynamicProperty((Name)"Count", (DynamicPropertyCalculator_T1)null));
        }
        public void Test_OperatorRegist_Fail_Null_Surogate()
        {
            var kb = new KB((Name)"Me");

            Assert.Throws <ArgumentNullException>(() => kb.RegistDynamicProperty((Name)"Count(John)", null, null));
        }
 public void BindCalls(KB kb)
 {
     kb.RegistDynamicProperty(EVENT_ID_PROPERTY_TEMPLATE, EventIdPropertyCalculator, new [] { "type", "subject", "def", "target" });
     kb.RegistDynamicProperty(EVENT_ELAPSED_TIME_PROPERTY_TEMPLATE, EventAgePropertyCalculator, new[] { "id" });
     kb.RegistDynamicProperty(LAST_EVENT_ID_PROPERTY_TEMPLATE, LastEventIdPropertyCalculator, new[] { "type", "subject", "def", "target" });
 }
Beispiel #9
0
 private void BindCalls(KB kb)
 {
     kb.RegistDynamicProperty(MOOD_TEMPLATE, MoodPropertyCalculator, new[] { "x" });
     kb.RegistDynamicProperty(STRONGEST_EMOTION_TEMPLATE, StrongestEmotionCalculator, new[] { "x" });
     kb.RegistDynamicProperty(EMOTION_INTENSITY_TEMPLATE, EmotionIntensityPropertyCalculator, new[] { "x", "y" });
 }
Beispiel #10
0
        public void Test_DynamicProperty_Regist_Fail_InvalidTemplate()
        {
            var kb = new KB((Name)"Me");

            Assert.Throws <ArgumentException>(() => kb.RegistDynamicProperty((Name)"CountSubs(John)", "", DummyCount));
        }