Exemplo n.º 1
0
 public void TestRaces()
 {
     var client = new WowClient(TestConstants.TestRegion, Properties.Settings.Default.PublicKey, TestConstants.TestLocale);
     var races = client.GetRacesAsync().Result;
     Assert.IsNotNull(races);
     Assert.IsTrue(races.Count > 0);
 }
 public void TestBattlegroups()
 {
     var client = new WowClient(TestConstants.TestRegion, Properties.Settings.Default.PublicKey, TestConstants.TestLocale);
     var battlegroups = client.GetBattlegroupsAsync().Result;
     Assert.IsNotNull(battlegroups);
     Assert.IsNotNull(battlegroups.Battlegroups);
     Assert.IsTrue(battlegroups.Battlegroups.Count > 0);
 }
Exemplo n.º 3
0
 public void TestItems()
 {
     var client = new WowClient(TestConstants.TestRegion, Properties.Settings.Default.PublicKey, TestConstants.TestLocale);
     var result = client.GetItemAsync(17182).Result;
     Assert.IsNotNull(result);
     Assert.IsTrue(result.ItemQuality == ItemQuality.Legendary);
     Assert.AreEqual(17182, result.Id);
     result = client.GetItemAsync(86879).Result;
     Assert.IsNotNull(result);
     Assert.IsTrue(result.IsUpgradable);
 }
Exemplo n.º 4
0
 public void TestPets()
 {
     var client = new WowClient(TestConstants.TestRegion, Properties.Settings.Default.PublicKey, TestConstants.TestLocale);
     var pets = client.GetBattlePetsAsync().Result;
     Assert.IsNotNull(pets);
     Assert.IsNotNull(pets.BattlePets);
     Assert.IsTrue(pets.BattlePets.Count > 0);
     var petAbility = client.GetBattlePetAbilityAsync(TestConstants.BattlePetAbilityId).Result;
     Assert.IsNotNull(petAbility);
     var petSpecies = client.GetBattlePetSpeciesAsync(TestConstants.BattlePetSpeciesId).Result;
     Assert.IsNotNull(petSpecies);
     var petStats = client.GetBattlePetStatsAsync(TestConstants.BattlePetSpeciesId, TestConstants.BattlePetStatsLevel, TestConstants.BattlePetStatsBreedId, TestConstants.BattlePetStatsQualityId).Result;
     Assert.IsNotNull(petStats);
 }
Exemplo n.º 5
0
 public void TestTalents()
 {
     var client = new WowClient(TestConstants.TestRegion, Properties.Settings.Default.PublicKey, TestConstants.TestLocale);
     var talents = client.GetTalentsAsync().Result;
     Assert.IsNotNull(talents);
     Assert.IsNotNull(talents.Warrior);
     Assert.IsNotNull(talents.Warlock);
     Assert.IsNotNull(talents.Shaman);
     Assert.IsNotNull(talents.Rogue);
     Assert.IsNotNull(talents.Priest);
     Assert.IsNotNull(talents.Paladin);
     Assert.IsNotNull(talents.Monk);
     Assert.IsNotNull(talents.Mage);
     Assert.IsNotNull(talents.Hunter);
     Assert.IsNotNull(talents.Druid);
     Assert.IsNotNull(talents.DeathKnight);
 }
 public void TestGuildRewards()
 {
     var client = new WowClient(TestConstants.TestRegion, Properties.Settings.Default.PublicKey, TestConstants.TestLocale);
     var result = client.GetGuildRewardsAsync().Result;
     Assert.IsNotNull(result);
     Assert.IsNotNull(result.Rewards);
     Assert.IsTrue(result.Rewards.Count > 0);
     Assert.IsNotNull(result.Rewards[0].ToString());
     Assert.IsTrue(result.Rewards.Any(r => r.Races != null));
     Assert.IsTrue(result.Rewards.Any(r => r.MinimumGuildLevel >= 0));
     Assert.IsTrue((int)result.Rewards[0].MinimumGuildReputationLevel > (int)Standing.Unfriendly);
     Assert.IsNotNull(result.Rewards[0].RewardItem);
     Assert.IsNotNull(result.Rewards[0].RewardItem.Icon);
     Assert.IsTrue(result.Rewards[0].RewardItem.Quality != ItemQuality.Poor);
     Assert.IsTrue(result.Rewards[0].RewardItem.Id > 0);
     Assert.IsNotNull(result.Rewards[0].RewardItem.Name);
     Assert.IsNotNull(result.Rewards[0].RewardItem.TooltipParameters);
     Assert.IsNotNull(result.Rewards[0].Achievement);
 }
Exemplo n.º 7
0
        public void TestGuild()
        {
            var client = new WowClient(TestConstants.TestRegion, Properties.Settings.Default.PublicKey, TestConstants.TestLocale);
            var guild = client.GetGuildAsync(TestConstants.TestRealmName, TestConstants.TestGuildName, GuildFields.All).Result;
            Assert.IsNotNull(guild);
            Assert.IsNotNull(guild.Members);
            Assert.IsNotNull(guild.Achievements);
            Assert.IsTrue(guild.Members.Count > 0);
            Assert.IsTrue(guild.Members.Any(m => m.Rank > 0));
            Assert.IsTrue(string.Equals(guild.Members[0].Character.Realm, TestConstants.TestRealmName,
                                        StringComparison.OrdinalIgnoreCase));
            Assert.IsTrue(string.Equals(guild.Name, TestConstants.TestGuildName, StringComparison.OrdinalIgnoreCase));
            Assert.IsNotNull(guild.ToString());
            Assert.IsNotNull(guild.Faction);
            Assert.IsNotNull(guild.Members[0].ToString());
            Assert.IsTrue(guild.AchievementPoints > 0);
            Assert.IsNotNull(guild.BattleGroupName);
            Assert.IsNotNull(guild.Emblem);
            Assert.IsNotNull(guild.Emblem.BackgroundColor);
            Assert.IsNotNull(guild.Emblem.BorderColor);
            Assert.IsNotNull(guild.Emblem.IconColor);
            Assert.IsTrue(guild.Emblem.Icon > 0);
            Assert.IsTrue(guild.Emblem.Border >= 0);
            Assert.IsTrue(guild.Level >= 25);
            Assert.AreEqual(TestConstants.TestRealmName, guild.Realm);

            Assert.IsNotNull(guild.News);
            Assert.IsTrue(guild.News.All(n => n != null));
            Assert.IsTrue(guild.News.All(n => n.Achievement != null
                                              ||
                                              (n.GuildNewsItemType != GuildNewsItemType.PlayerAchievement &&
                                               n.GuildNewsItemType != GuildNewsItemType.GuildAchievement)));
            Assert.IsTrue(guild.News.All(n => n.ItemId > 0
                                              ||
                                              (n.GuildNewsItemType == GuildNewsItemType.PlayerAchievement ||
                                               n.GuildNewsItemType == GuildNewsItemType.GuildAchievement)));

            Assert.IsNotNull(guild.Challenges);
            Assert.AreNotEqual(0, guild.Challenges.Count);
        }
Exemplo n.º 8
0
        public void TestAuctions()
        {
            var client = new WowClient(TestConstants.TestRegion, Properties.Settings.Default.PublicKey, TestConstants.TestLocale);
            var result = client.GetAuctionDumpAsync(TestConstants.TestAuctionHouseRealm).Result;

            Assert.IsNotNull(result);
            Assert.IsNotNull(result.Realms);
            Assert.IsNotNull(result.Auctions);
            Assert.IsTrue(result.Auctions.Count > 0);

            Assert.IsTrue(result.ToString().StartsWith(result.Auctions.Count.ToString(CultureInfo.InvariantCulture)));

            var auction = result.Auctions.FirstOrDefault(a => a.BuyoutValue.HasValue);
            Assert.IsNotNull(auction);
            Assert.IsTrue(auction.AuctionId > 0);
            Assert.IsTrue(auction.ItemId > 0);
            Assert.IsNotNull(auction.OwnerName != null);
            Assert.IsTrue(auction.Quantity >= 1);
            Assert.IsTrue(auction.CurrentBidValue > 0);
            Assert.IsTrue(auction.BuyoutValue != null && auction.BuyoutValue.Value >= auction.CurrentBidValue);
            Assert.IsNotNull(auction.ToString());
        }
Exemplo n.º 9
0
 public void TestPetTypes()
 {
     var client = new WowClient(TestConstants.TestRegion, Properties.Settings.Default.PublicKey, TestConstants.TestLocale);
     var petTypes = client.GetBattlePetTypesAsync().Result;
     Assert.IsNotNull(petTypes);
 }