Esempio n. 1
0
        private string GetRandomItemName(string itemType)
        {
            var itemNames = Enumerable.Empty <string>();

            switch (itemType)
            {
            case ItemTypeConstants.AlchemicalItem:
                itemNames = AlchemicalItemConstants.GetAllAlchemicalItems(); break;

            case ItemTypeConstants.Armor:
                itemNames = ArmorConstants.GetAllArmorsAndShields(true); break;

            case ItemTypeConstants.Potion:
                itemNames = PotionConstants.GetAllPotions(true); break;

            case ItemTypeConstants.Ring:
                itemNames = RingConstants.GetAllRings(); break;

            case ItemTypeConstants.Rod:
                itemNames = RodConstants.GetAllRods(); break;

            case ItemTypeConstants.Scroll:
                itemNames = new[] { $"Scroll {Guid.NewGuid()}" }; break;

            case ItemTypeConstants.Staff:
                itemNames = StaffConstants.GetAllStaffs(); break;

            case ItemTypeConstants.Tool:
                itemNames = ToolConstants.GetAllTools(); break;

            case ItemTypeConstants.Wand:
                itemNames = new[] { $"Wand {Guid.NewGuid()}" }; break;

            case ItemTypeConstants.Weapon:
                itemNames = WeaponConstants.GetAllWeapons(true, true); break;

            case ItemTypeConstants.WondrousItem:
                itemNames = WondrousItemConstants.GetAllWondrousItems(); break;
            }

            var itemName = collectionSelector.SelectRandomFrom(itemNames);

            return(itemName);
        }
        public void AllRings()
        {
            var rings = RingConstants.GetAllRings();

            Assert.That(rings, Contains.Item(RingConstants.AcidResistance_Greater));
            Assert.That(rings, Contains.Item(RingConstants.AcidResistance_Major));
            Assert.That(rings, Contains.Item(RingConstants.AcidResistance_Minor));
            Assert.That(rings, Contains.Item(RingConstants.AnimalFriendship));
            Assert.That(rings, Contains.Item(RingConstants.Blinking));
            Assert.That(rings, Contains.Item(RingConstants.ChameleonPower));
            Assert.That(rings, Contains.Item(RingConstants.Climbing));
            Assert.That(rings, Contains.Item(RingConstants.Climbing_Improved));
            Assert.That(rings, Contains.Item(RingConstants.Clumsiness));
            Assert.That(rings, Contains.Item(RingConstants.ColdResistance_Greater));
            Assert.That(rings, Contains.Item(RingConstants.ColdResistance_Major));
            Assert.That(rings, Contains.Item(RingConstants.ColdResistance_Minor));
            Assert.That(rings, Contains.Item(RingConstants.Counterspells));
            Assert.That(rings, Contains.Item(RingConstants.DjinniCalling));
            Assert.That(rings, Contains.Item(RingConstants.ElectricityResistance_Greater));
            Assert.That(rings, Contains.Item(RingConstants.ElectricityResistance_Major));
            Assert.That(rings, Contains.Item(RingConstants.ElectricityResistance_Minor));
            Assert.That(rings, Contains.Item(RingConstants.ElementalCommand_Air));
            Assert.That(rings, Contains.Item(RingConstants.ElementalCommand_Earth));
            Assert.That(rings, Contains.Item(RingConstants.ElementalCommand_Fire));
            Assert.That(rings, Contains.Item(RingConstants.ElementalCommand_Water));
            Assert.That(rings, Contains.Item(RingConstants.Evasion));
            Assert.That(rings, Contains.Item(RingConstants.FeatherFalling));
            Assert.That(rings, Contains.Item(RingConstants.FireResistance_Greater));
            Assert.That(rings, Contains.Item(RingConstants.FireResistance_Major));
            Assert.That(rings, Contains.Item(RingConstants.FireResistance_Minor));
            Assert.That(rings, Contains.Item(RingConstants.ForceShield));
            Assert.That(rings, Contains.Item(RingConstants.FreedomOfMovement));
            Assert.That(rings, Contains.Item(RingConstants.FriendShield));
            Assert.That(rings, Contains.Item(RingConstants.Invisibility));
            Assert.That(rings, Contains.Item(RingConstants.Jumping));
            Assert.That(rings, Contains.Item(RingConstants.Jumping_Improved));
            Assert.That(rings, Contains.Item(RingConstants.MindShielding));
            Assert.That(rings, Contains.Item(RingConstants.Protection));
            Assert.That(rings, Contains.Item(RingConstants.Ram));
            Assert.That(rings, Contains.Item(RingConstants.Regeneration));
            Assert.That(rings, Contains.Item(RingConstants.ShootingStars));
            Assert.That(rings, Contains.Item(RingConstants.SonicResistance_Greater));
            Assert.That(rings, Contains.Item(RingConstants.SonicResistance_Major));
            Assert.That(rings, Contains.Item(RingConstants.SonicResistance_Minor));
            Assert.That(rings, Contains.Item(RingConstants.SpellStoring));
            Assert.That(rings, Contains.Item(RingConstants.SpellStoring_Major));
            Assert.That(rings, Contains.Item(RingConstants.SpellStoring_Minor));
            Assert.That(rings, Contains.Item(RingConstants.SpellTurning));
            Assert.That(rings, Contains.Item(RingConstants.Sustenance));
            Assert.That(rings, Contains.Item(RingConstants.Swimming));
            Assert.That(rings, Contains.Item(RingConstants.Swimming_Improved));
            Assert.That(rings, Contains.Item(RingConstants.ThreeWishes));
            Assert.That(rings, Contains.Item(RingConstants.Telekinesis));
            Assert.That(rings, Contains.Item(RingConstants.WaterWalking));
            Assert.That(rings, Contains.Item(RingConstants.Wizardry_I));
            Assert.That(rings, Contains.Item(RingConstants.Wizardry_II));
            Assert.That(rings, Contains.Item(RingConstants.Wizardry_III));
            Assert.That(rings, Contains.Item(RingConstants.Wizardry_IV));
            Assert.That(rings, Contains.Item(RingConstants.XRayVision));
            Assert.That(rings.Count(), Is.EqualTo(55));
        }
Esempio n. 3
0
 protected override IEnumerable <string> GetItemNames()
 {
     return(RingConstants.GetAllRings());
 }