Esempio n. 1
0
 public void AvoidTryingToBuyWeaponsIfBroke()
 {
     character.Inventory.CoinPurse.SetValue(2999); // Not Enough :'(
     subject.ExecuteStep(character);
     Assert.Equal(2999, character.Inventory.CoinPurse.Value);
     Assert.Equal(0, character.Inventory.Weapons.Count());
 }
Esempio n. 2
0
        public void IfNoAppropriateItemsAreFoundAssignNothing()
        {
            var action    = new PurchaseRangedWeapon(shop);
            var character = CharacterTestTemplates.AverageBob();

            character.Inventory.CoinPurse.SetValue(30000);
            //With no specification nothing should match
            action.ExecuteStep(character);
            Assert.Empty(character.Inventory.Weapons);
        }
Esempio n. 3
0
        public void CharactersGetARangedAndMeleeWeaponTheyAreProficientIn()
        {
            //Bad test, but good enough for now
            var action        = new PurchaseRangedWeapon(shop);
            var proficiencies = new string[] { "simple", "martial" };
            var character     = CharacterTestTemplates.AverageBob();

            character.Inventory.CoinPurse.SetValue(30000);

            character.Offense.AddWeaponProficiencies(proficiencies);
            action.ExecuteStep(character);
            Assert.Equal(character.Inventory.Weapons.Count(), 1);
            Assert.True(character.Inventory.Weapons.Any(x => x.Type == WeaponType.Ranged));
            Assert.False(character.Inventory.Weapons.Any(x => x.Type != WeaponType.Ranged));
            Assert.False(character.Inventory.Weapons.Any(x => x.Level == WeaponTrainingLevel.Exotic));
        }