コード例 #1
0
        public void Test_DynamicProperty_Regist_Fail_Duplicate()
        {
            var kb = new KB((Name)"Me");

            Assert.Throws <ArgumentException>(
                () => kb.RegistDynamicProperty((Name)"Count", DummyCount));
        }
コード例 #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));
        }
コード例 #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));
            });
        }
コード例 #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);
            });
        }
コード例 #5
0
ファイル: KBTests.cs プロジェクト: pcannon67/FAtiMA-Toolkit
        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);
            });
        }
コード例 #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));
        }
コード例 #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));
        }
コード例 #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" });
 }
コード例 #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" });
 }
コード例 #10
0
ファイル: KBTests.cs プロジェクト: pcannon67/FAtiMA-Toolkit
        public void Test_DynamicProperty_Regist_Fail_InvalidTemplate()
        {
            var kb = new KB((Name)"Me");

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