コード例 #1
0
        public void Apply_NotACharacter_Test()
        {
            var entity    = Mock.Of <IEntity>();
            var invisible = new Invisible();

            invisible.Apply(entity);
            Assert.IsTrue(true); // If we made it here without exception then the test passed
        }
コード例 #2
0
        public void Remove_NoConditions_Test()
        {
            var character = CreateMockCharacter();
            var invisible = new Invisible();

            invisible.Apply(character);
            invisible.Remove(character);
            Assert.AreEqual(0, character.Conditions.Count);
        }
コード例 #3
0
        public void Apply_Character_WithExistingInvisibleCondition_Test()
        {
            var character = CreateMockCharacter();

            character.Conditions.Add(new Invisible());
            var invisible = new Invisible();

            invisible.Apply(character);
        }
コード例 #4
0
        public void Apply_Character_NoConditions_Test()
        {
            var character = CreateMockCharacter();
            var invisible = new Invisible();

            invisible.Apply(character);
            Assert.AreEqual(EntityIds.INVISIBLE_CONDITION_ID, character.Conditions[0].Id);
            Assert.AreSame(invisible, character.Conditions[0]);
            Assert.AreEqual(ConditionGroup.Senses, character.Conditions[0].Group);
        }