コード例 #1
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));
        }
コード例 #2
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);
        }
コード例 #3
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);
        }