Exemplo n.º 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
        }
Exemplo n.º 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);
        }
Exemplo n.º 3
0
        public void Apply_Character_WithExistingRestrainedCondition_Test()
        {
            var character = CreateMockCharacter();

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

            restrained.Apply(character);
        }
Exemplo n.º 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));
        }
Exemplo n.º 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);
        }
Exemplo n.º 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);
        }
Exemplo n.º 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));
        }
Exemplo n.º 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));
        }
Exemplo n.º 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));
        }