Esempio n. 1
0
        public void DistanceTokenCorrectlyExtractsInformation()
        {
            var token = new DistanceToken(TokenContext.Create(@"{distance:5}"));

            Assert.AreEqual(5, token.Distance);
            Assert.IsTrue(new int[] { 0 }.SequenceEqual(token.Context.Groups));
        }
Esempio n. 2
0
        public void ReachTokenCorrectlyExtractsInformation()
        {
            var token = new ReachToken(TokenContext.Create(@"{reach:5}"));

            Assert.AreEqual(5, token.Reach);
            Assert.IsTrue(new int[] { 0 }.SequenceEqual(token.Context.Groups));
        }
Esempio n. 3
0
        public void DamageTypeTokenCorrectlyExtractsInformation()
        {
            var token = new DamageTypeToken(TokenContext.Create(@"{type:bludgeoning}"));

            Assert.AreEqual(DamageType.Bludgeoning, token.DamageType);
            Assert.IsTrue(new int[] { 0 }.SequenceEqual(token.Context.Groups));
        }
Esempio n. 4
0
        public void DCTokenCorrectlyExtractsInformation()
        {
            var token = new DifficultyClassToken(TokenContext.Create(@"{DC:wisdom+p}"));

            Assert.AreEqual(Ability.Wisdom, token.Ability);
            Assert.IsTrue(token.Proficient);
            Assert.IsTrue(new int[] { 0 }.SequenceEqual(token.Context.Groups));
        }
Esempio n. 5
0
        public void AttackTokenCorrectlyExtractsInformation()
        {
            var token = new AttackToken(TokenContext.Create(@"{attack:str+p}"));

            Assert.AreEqual(Ability.Strength, token.Ability);
            Assert.IsTrue(token.Proficient);
            Assert.IsTrue(new int[] { 0 }.SequenceEqual(token.Context.Groups));
        }
Esempio n. 6
0
        public void ReachTokenCorrectlyFormatted()
        {
            var token = new ReachToken(TokenContext.Create(@"{reach:5}"));

            var actual   = token.Format(azer);
            var expected = @"5";

            Assert.AreEqual(expected, actual);
        }
Esempio n. 7
0
        public void DamageTypeTokenCorrectlyFormatted()
        {
            var token = new DamageTypeToken(TokenContext.Create(@"{type:bludgeoning}"));

            var actual   = token.Format(azer);
            var expected = @"bludgeoning";

            Assert.AreEqual(expected, actual);
        }
Esempio n. 8
0
        public void DCTokenCorrectlyFormatted()
        {
            var token = new DifficultyClassToken(TokenContext.Create(@"{DC:wisdom+p}"));

            var actual   = token.Format(azer);
            var expected = @"DC 10";

            Assert.AreEqual(expected, actual);
        }
Esempio n. 9
0
        public void AttackTokenCorrectlyFormatted()
        {
            var token = new AttackToken(TokenContext.Create(@"{attack:str+p}"));

            var actual   = token.Format(azer);
            var expected = @"+5";

            Assert.AreEqual(expected, actual);
        }
Esempio n. 10
0
        public void DamageTokenCorrectlyFormatted()
        {
            var token = new DamageToken(TokenContext.Create(@"{damage:1d8+str:1,2}"));

            var actual   = token.Format(azer);
            var expected = @"7 (1d8 + 3)";

            Assert.AreEqual(expected, actual);
        }
Esempio n. 11
0
        public void DamageTokenCorrectlyExtractsInformation()
        {
            var token = new DamageToken(TokenContext.Create(@"{damage:1d8+str:1,2}"));

            Assert.AreEqual(1, token.Count);
            Assert.AreEqual(Die.D8, token.Size);
            Assert.AreEqual(Ability.Strength, token.ModifiedBy);
            Assert.AreEqual(0, token.FlatBonus);
            Assert.IsTrue(new int[] { 1, 2 }.SequenceEqual(token.Context.Groups));
        }
Esempio n. 12
0
        public void DamageTypeTokenCorrectlyRetokenizes()
        {
            var token = new DamageTypeToken(TokenContext.Create(@"{type:bludgeoning}"));

            token.DamageType = DamageType.Fire;

            var actual   = token.TokenText;
            var expected = @"{type:fire}";

            Assert.AreEqual(expected, actual);
        }
Esempio n. 13
0
        public void ReachTokenCorrectlyRetokenizes()
        {
            var token = new ReachToken(TokenContext.Create(@"{reach:5}"));

            token.Reach = 6;

            var actual   = token.TokenText;
            var expected = @"{reach:6}";

            Assert.AreEqual(expected, actual);
        }
Esempio n. 14
0
        public void DistanceTokenCorrectlyRetokenizes()
        {
            var token = new DistanceToken(TokenContext.Create(@"{distance:5}"));

            token.Distance = 6;

            var actual   = token.TokenText;
            var expected = @"{distance:6}";

            Assert.AreEqual(expected, actual);
        }
Esempio n. 15
0
        public void AreaTokenCorrectlyRetokenizes()
        {
            var token = new AreaToken(TokenContext.Create(@"{area:5}"));

            token.Area = 6;

            var actual   = token.TokenText;
            var expected = @"{area:6}";

            Assert.AreEqual(expected, actual);
        }
Esempio n. 16
0
        public void DCTokenCorrectlyRetokenizes()
        {
            var token = new DifficultyClassToken(TokenContext.Create(@"{DC:wisdom+p}"));

            token.Ability    = Ability.Charisma;
            token.Proficient = true;

            var actual   = token.TokenText;
            var expected = @"{dc:cha+p}";

            Assert.AreEqual(expected, actual);
        }
Esempio n. 17
0
        public void AttackTokenCorrectlyRetokenizes()
        {
            var token = new AttackToken(TokenContext.Create(@"{attack:str+p}"));

            token.Ability    = Ability.Wisdom;
            token.Proficient = false;

            var actual   = token.TokenText;
            var expected = @"{attack:wis}";

            Assert.AreEqual(expected, actual);
        }
Esempio n. 18
0
        public void DamageTokenCorrectlyRetokenizes()
        {
            var token = new DamageToken(TokenContext.Create(@"{damage:1d8+str:1,2}"));

            token.Count      = 2;
            token.Size       = Die.D10;
            token.ModifiedBy = Ability.Intelligence;

            var actual   = token.TokenText;
            var expected = @"{damage:2d10+int:1,2}";

            Assert.AreEqual(expected, actual);
        }