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)); }
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)); }
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)); }
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)); }
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)); }
public void ReachTokenCorrectlyFormatted() { var token = new ReachToken(TokenContext.Create(@"{reach:5}")); var actual = token.Format(azer); var expected = @"5"; Assert.AreEqual(expected, actual); }
public void DamageTypeTokenCorrectlyFormatted() { var token = new DamageTypeToken(TokenContext.Create(@"{type:bludgeoning}")); var actual = token.Format(azer); var expected = @"bludgeoning"; Assert.AreEqual(expected, actual); }
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); }
public void AttackTokenCorrectlyFormatted() { var token = new AttackToken(TokenContext.Create(@"{attack:str+p}")); var actual = token.Format(azer); var expected = @"+5"; Assert.AreEqual(expected, actual); }
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); }
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)); }
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); }
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); }
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); }
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); }
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); }
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); }
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); }