Exemple #1
0
        public void Apply_NotACharacter_Test()
        {
            var entity     = Mock.Of <IEntity>();
            var restrained = new Restrained();

            restrained.Apply(entity);
            Assert.IsTrue(true); // If we made it here without exception then the test passed
        }
Exemple #2
0
        public void Remove_NoConditions_Test()
        {
            var character  = CreateMockCharacter();
            var restrained = new Restrained();

            restrained.Apply(character);
            restrained.Remove(character);
            Assert.AreEqual(0, character.Conditions.Count);
        }
Exemple #3
0
        public void Apply_Character_WithExistingRestrainedCondition_Test()
        {
            var character = CreateMockCharacter();

            character.Conditions.Add(new Restrained());
            var restrained = new Restrained();

            restrained.Apply(character);
        }
Exemple #4
0
        public void Apply_Character_NoConditions_Test()
        {
            var character  = CreateMockCharacter();
            var restrained = new Restrained();

            restrained.Apply(character);
            Assert.IsTrue(character.Conditions.Any(c => c.Id == EntityIds.RESTRAINED_CONDITION_ID));
            Assert.IsTrue(character.Conditions.Any(c => c.Id == EntityIds.FLAT_FOOTED_CONDITION_ID));
            Assert.IsTrue(character.Conditions.Any(c => c.Id == EntityIds.IMMOBILIZED_CONDITION_ID));
        }
Exemple #5
0
        public void Remove_FlatFootedToOneExists_Test()
        {
            var character  = CreateMockCharacter();
            var flatFooted = new FlatFooted(1);

            flatFooted.Apply(character);
            var restrained = new Restrained();

            restrained.Apply(character);
            restrained.Remove(character);
            Assert.AreEqual(0, character.Conditions.Count);
        }
Exemple #6
0
        public void Apply_Character_FlatFootedToAllExists_Test()
        {
            var character  = CreateMockCharacter();
            var flatFooted = new FlatFooted(FlatFooted.AllCharacters);

            flatFooted.Apply(character);
            var restrained = new Restrained();

            restrained.Apply(character);
            var newFlatFooted = (FlatFooted)character.Conditions.First(c => c.Id == EntityIds.FLAT_FOOTED_CONDITION_ID);

            Assert.AreSame(flatFooted, newFlatFooted);
        }
Exemple #7
0
        public void Remove_ImmobilizedExists_Test()
        {
            var character   = CreateMockCharacter();
            var immobilized = new Immobilized();

            immobilized.Apply(character);
            var restrained = new Restrained();

            restrained.Apply(character);
            restrained.Remove(character);
            Assert.AreEqual(1, character.Conditions.Count);
            Assert.IsTrue(character.Conditions.Contains(immobilized));
        }
Exemple #8
0
        public void Remove_FlatFootedToAllExists_Test()
        {
            var character  = CreateMockCharacter();
            var flatFooted = new FlatFooted(FlatFooted.AllCharacters);

            flatFooted.Apply(character);
            var restrained = new Restrained();

            restrained.Apply(character);
            restrained.Remove(character);
            Assert.AreEqual(1, character.Conditions.Count);
            Assert.IsTrue(character.Conditions.Contains(flatFooted));
        }
Exemple #9
0
        public void Apply_Character_FlatFootedToOneExists_Test()
        {
            var character  = CreateMockCharacter();
            var flatFooted = new FlatFooted(1);

            flatFooted.Apply(character);
            var restrained = new Restrained();

            restrained.Apply(character);
            var newFlatFooted = (FlatFooted)character.Conditions.First(c => c.Id == EntityIds.FLAT_FOOTED_CONDITION_ID);

            Assert.AreNotSame(flatFooted, newFlatFooted);
            Assert.IsFalse(newFlatFooted.FlatFootedFrom.Contains(1));
            Assert.IsTrue(newFlatFooted.FlatFootedFrom.Contains(FlatFooted.AllCharacters));
        }