コード例 #1
0
        public void RepeatedDeletionIsOkayTest()
        {
            var ai = new UtilityAi();
            var b  = new Behaviour();

            b.NameId = "beh";
            Assert.That(ai.AddBehaviour(b), Is.True);
            Assert.That(ai.RemoveBehaviour(b), Is.True);
            Assert.That(ai.RemoveBehaviour(b), Is.False);
        }
コード例 #2
0
        public void RemoveNonExistentStringBehaviourReturnsFalseTest()
        {
            _aic.Clear();
            var ai = new UtilityAi("testai", _aic);

            Assert.That(ai.RemoveBehaviour("some"), Is.False);
        }
コード例 #3
0
        public void RemoveStringBehaviourReturnsTrueTest()
        {
            _aic.Clear();
            var ai = new UtilityAi("testai", _aic);

            Assert.That(ai.AddBehaviour("b1"), Is.True);
            Assert.That(ai.RemoveBehaviour("b1"), Is.True);
        }
コード例 #4
0
        public void RemoveNullBehaviourDoesNotThrowTest()
        {
            var ai = new UtilityAi();

            Assert.DoesNotThrow(() => ai.RemoveBehaviour((Behaviour)null));
        }