Пример #1
0
        public Character(string characterName)
        {
            try
            {
                var fantasyNameSettings = new FantasyNameSettings(Classes.Warrior, Race.None, true, true, Gender.Male);
                IFantasyNameGenerator fantasyNameGenerator = FantasyNameGenerator.FromSettingsInfo(fantasyNameSettings);
                FantasyName[]         names = fantasyNameGenerator.GetFantasyNames(1);
                CharacterName = characterName == null || characterName == "" ? names[0].FullName : characterName;
            }
            catch
            {
                CharacterName = characterName == null || characterName == "" ? "Crash Bandicoot" : characterName;
            }


            Strength  = rnd.Next(10, 18);
            Agility   = rnd.Next(10, 18);
            MaxHealth = 100;
            Health    = MaxHealth;
            SetDamage();
            SetHitChance();
            SetCritChance();
            SetBlock();
            SetSpeed();
        }
        public void Female_Goblin_Warrior()
        {
            // arrange
            NameGenerator.GetRandomNumber = (maxValue) => 1;
            IFantasyNameGenerator fantasyNameGenerator = FantasyNameGenerator.FromSettingsInfo(new FantasyNameSettings(Classes.Warrior, Race.Goblin, true, true, Gender.Female));

            // act
            var names = fantasyNameGenerator.GetFantasyNames(2);

            // assert
            ApprovalTests.Approvals.VerifyAll("Female Goblin Names", names, "names");
        }