コード例 #1
0
        public void NameShouldReflectFavoredEnemyAndBonus()
        {
            var creatureType = new CreatureType("Outsider", "Fire");
            var favEnemy     = new FavoredEnemy(creatureType);

            Assert.Equal(favEnemy.DisplayString(), "Favored Enemy (Outsider (Fire) +2)");
        }
コード例 #2
0
        public void CanHaveMultipleFavoredEnemies()
        {
            var dragons = new CreatureType("Dragons");
            var rats    = new CreatureType("Rats");

            var favEnemy = new FavoredEnemy(dragons);

            favEnemy.Add(rats);
            Assert.Contains(dragons, favEnemy.CreatureTypes);
            Assert.Contains(rats, favEnemy.CreatureTypes);
            Assert.Equal(favEnemy.Bonus(rats), 2);
            Assert.Equal(favEnemy.Bonus(dragons), 2);
            Assert.Equal(favEnemy.DisplayString(), "Favored Enemy (Dragons +2, Rats +2)");
        }