Пример #1
0
        public void Apply_NotACharacter_Test()
        {
            var entity = Mock.Of <IEntity>();
            var prone  = new Prone();

            prone.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 prone     = new Prone();

            prone.Apply(character);
            prone.Remove(character);
            Assert.AreEqual(0, character.Conditions.Count);
        }
Пример #3
0
        public void Apply_Character_WithExistingProneCondition_Test()
        {
            var character = CreateMockCharacter();

            character.Conditions.Add(new Prone());
            var prone = new Prone();

            prone.Apply(character);
        }
Пример #4
0
        public void Apply_Character_NoConditions_Test()
        {
            var character = CreateMockCharacter();
            var prone     = new Prone();

            prone.Apply(character);
            Assert.AreEqual(EntityIds.PRONE_CONDITION_ID, character.Conditions[0].Id);
            Assert.IsTrue(character.Conditions.Any(c => c.Id == EntityIds.PRONE_CONDITION_ID));
            Assert.IsTrue(character.Conditions.Any(c => c.Id == EntityIds.FLAT_FOOTED_CONDITION_ID));
        }
Пример #5
0
        public void Apply_Character_FlatFootedToAllExists_Test()
        {
            var character  = CreateMockCharacter();
            var flatFooted = new FlatFooted(FlatFooted.AllCharacters);
            var prone      = new Prone();

            prone.Apply(character);
            var savedFlatFooted = (FlatFooted)character.Conditions.FirstOrDefault(c => c.Id == EntityIds.FLAT_FOOTED_CONDITION_ID);

            Assert.AreSame(flatFooted, savedFlatFooted);
        }
Пример #6
0
        public void Remove_WithExistingFlatFootedToOne_Test()
        {
            var character  = CreateMockCharacter();
            var flatFooted = new FlatFooted(1);

            flatFooted.Apply(character);
            var prone = new Prone();

            prone.Apply(character);
            prone.Remove(character);
            Assert.AreEqual(0, character.Conditions.Count);
        }
Пример #7
0
        public void Apply_Character_FlatFootedToOneExists_Test()
        {
            var character  = CreateMockCharacter();
            var flatFooted = new FlatFooted(1);
            var prone      = new Prone();

            prone.Apply(character);
            var savedFlatFooted = (FlatFooted)character.Conditions.FirstOrDefault(c => c.Id == EntityIds.FLAT_FOOTED_CONDITION_ID);

            Assert.IsTrue(savedFlatFooted.FlatFootedFrom.Contains(FlatFooted.AllCharacters));
            Assert.IsFalse(savedFlatFooted.FlatFootedFrom.Contains(1));
        }
Пример #8
0
        public void Remove_WithExistingFlatFootedToAll_Test()
        {
            var character  = CreateMockCharacter();
            var flatFooted = new FlatFooted(FlatFooted.AllCharacters);

            flatFooted.Apply(character);
            var prone = new Prone();

            prone.Apply(character);
            prone.Remove(character);
            Assert.AreEqual(1, character.Conditions.Count);
            Assert.AreSame(flatFooted, character.Conditions[0]);
        }