Esempio n. 1
0
        public void Apply_NotACharacter_Test()
        {
            var entity = Mock.Of <IEntity>();
            var dying  = new Dying(1);

            dying.Apply(entity);
            Assert.IsTrue(true); // If we made it here without exception then the test passed
        }
Esempio n. 2
0
        public void Apply_Character_WithExistingDyingCondition_Test()
        {
            var character = CreateMockCharacter();

            character.Conditions.Add(new Dying(1));
            var dying = new Dying(2);

            dying.Apply(character);
        }
Esempio n. 3
0
        public void Apply_Character_NoConditions_Test()
        {
            var character = CreateMockCharacter();
            var dying     = new Dying(1);

            dying.Apply(character);
            Assert.AreEqual(EntityIds.DYING_CONDITION_ID, character.Conditions[0].Id);
            Assert.AreEqual(1, character.Conditions[0].Level);
            Assert.AreSame(dying, character.Conditions[0]);
            Assert.IsTrue(character.Conditions.Any(c => c.Id == EntityIds.UNCONSCIOUS_CONDITION_ID));
        }
Esempio n. 4
0
        public void Remove_NoConditions_Test()
        {
            var character = CreateMockCharacter();
            var dying     = new Dying(1);

            dying.Apply(character);
            dying.Remove(character);
            Assert.AreEqual(1, character.Conditions.Count);
            var wounded = character.Conditions.FirstOrDefault(c => c.Id == EntityIds.WOUNDED_CONDITION_ID);

            Assert.IsNotNull(wounded);
            Assert.AreEqual(1, wounded.Level);
        }
Esempio n. 5
0
        public void Remove_WithExistingWoundedCondition_Test()
        {
            var character = CreateMockCharacter();
            var wounded   = new Wounded(1);

            wounded.Apply(character);
            var dying = new Dying(1);

            dying.Apply(character);
            dying.Remove(character);
            Assert.AreEqual(1, character.Conditions.Count);
            Assert.AreEqual(2, character.Conditions.First(c => c.Id == wounded.Id).Level);
        }
Esempio n. 6
0
        public void Apply_Character_WithExistingWoundedCondition_Test()
        {
            var character = CreateMockCharacter();
            var wounded   = new Wounded(1);

            wounded.Apply(character);
            var dying = new Dying(1);

            dying.Apply(character);
            Assert.AreEqual(2, character.Conditions.First(c => c.Id == dying.Id).Level);
            Assert.AreEqual(1, character.Conditions.First(c => c.Id == wounded.Id).Level);
            Assert.AreEqual(ConditionGroup.DeathAndDying, character.Conditions[0].Group);
        }