Ejemplo n.º 1
0
        public void Test_DynamicProperty_Regist_Fail_Duplicate()
        {
            var kb = new KB((Name)"Me");

            Assert.Throws <ArgumentException>(
                () => kb.RegistDynamicProperty((Name)"Count", DummyCount));
        }
Ejemplo n.º 2
0
        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));
        }
Ejemplo n.º 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));
            });
        }
Ejemplo n.º 4
0
        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);
            });
        }
Ejemplo n.º 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);
            });
        }
Ejemplo n.º 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));
        }
Ejemplo n.º 7
0
        public void Test_OperatorRegist_Fail_Null_Surogate()
        {
            var kb = new KB((Name)"Me");

            Assert.Throws <ArgumentNullException>(() => kb.RegistDynamicProperty((Name)"Count(John)", null, null));
        }
Ejemplo n.º 8
0
 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" });
 }
Ejemplo n.º 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" });
 }
Ejemplo n.º 10
0
        public void Test_DynamicProperty_Regist_Fail_InvalidTemplate()
        {
            var kb = new KB((Name)"Me");

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