public void TestCacheFailOnGet() { var client = new WowClient(TestConstants.TestRegion, null, new MockupCache(false, true)); Assert.IsNotNull(client.GetItemAsync(49110).Result); Assert.IsNotNull(client.GetItemAsync(49110).Result); }
public void TestAuctions() { var client = new WowClient(TestConstants.TestRegionName, new ApiKeyPair(TestConstants.PublicKey, TestConstants.PrivateKey), null, null); //var result = client.GetAuctionDump(TestConstants.TestRealmName); var result = client.GetAuctionDumpAsync(TestConstants.TestAuctionHouseRealm).Result; Assert.IsNotNull(result); Assert.IsNotNull(result.Neutral); Assert.IsNotNull(result.Alliance); Assert.IsNotNull(result.Alliance.Auctions); Assert.IsNotNull(result.Horde); Assert.IsNotNull(result.Realm); Assert.IsNotNull(result.Horde.Auctions); Assert.IsTrue(result.Horde.Auctions.Count > 0); Assert.IsTrue( result.Horde.ToString().StartsWith(result.Horde.Auctions.Count.ToString(CultureInfo.InvariantCulture))); var auction = result.Horde.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()); }
/// <summary> /// Gets guild members /// </summary> /// <param name="sender"> </param> /// <param name="e"> </param> private async void GetMembersButtonClick(object sender, RoutedEventArgs e) { var client = new WowClient((Region)RegionCombo.SelectedValue); var guild = await client.GetGuildAsync(RealmNameText.Text, GuildNameText.Text, GuildFields.Members); GuildMembersGrid.ItemsSource = guild.Members.Select(member => member.Character); }
public void TestPetTypes() { var client = new WowClient(TestConstants.TestRegion, Properties.Settings.Default.PublicKey, TestConstants.TestLocale); var petTypes = client.GetBattlePetTypesAsync().Result; Assert.IsNotNull(petTypes); }
//requires new guild to test against [TestMethod] public async Task Test_GetCharacter_FromGuildMembers() { var client = new WowClient(Region.EU, Locale.en_GB, TestConstants.ApiKey); //realm in getGuildAsync does not work (404 not found), why? setting realm in apiclient constructor works. var guild = await client.GetGuildAsync("method", GuildOptions.Members, "Twisting Nether"); Assert.IsNotNull(guild); Stopwatch s1 = new Stopwatch(); s1.Start(); int iteration = 0; var charc = await client.GetCharactersInGuildAsync(guild.Members, CharacterOptions.AllOptions, 100, 60); foreach (var c in charc) { iteration++; Console.WriteLine("Iteration Nr: " + iteration + " ------------------------------"); Console.WriteLine("Name: " + c.Name + "\nAchivement points: " + c.AchievementPoints + "\nLevel: " + c.Level); Console.WriteLine("----------------------------------------------"); } Console.WriteLine("Asynchronous time: " + s1.Elapsed.TotalSeconds + " sec"); s1.Stop(); }
public void TestRefreshCharacter() { var client = new WowClient(TestConstants.TestRegionName, TestConstants.Credentials, null, null); var character = client.GetCharacterAsync(TestConstants.TestRealmName, TestConstants.TestCharacterName, CharacterFields.All).Result; character.RefreshAsync(client).Wait(); }
public void TestCharacterProgression2() { var client = new WowClient(TestConstants.TestRegionName, TestConstants.Credentials, null, null); var character = client.GetCharacterAsync(TestConstants.TestRealmName, TestConstants.TestCharacterName, CharacterFields.Progression).Result; Assert.IsNotNull(character); Assert.IsNotNull(character.Progression); Assert.IsNotNull(character.Progression.Raids); Assert.IsTrue(character.Progression.Raids.Count > 0); var instance = character.Progression.Raids.FirstOrDefault(r => r.HeroicProgress == CharacterInstanceStatus.Completed); Assert.IsNotNull(instance); Assert.IsNotNull(instance.Name); Assert.IsTrue(instance.Id > 0); Assert.IsNotNull(instance.Bosses); Assert.IsTrue(instance.Bosses.Count > 0); Assert.IsNotNull(instance.Bosses[0]); Assert.IsNotNull(instance.Bosses[0].Name); Assert.IsNotNull(instance.Bosses[0].Id > 0); Assert.AreNotEqual(0, instance.Bosses[0].HeroicKills); Assert.AreNotEqual(1, instance.Bosses[0].NormalKills); Assert.AreEqual(CharacterInstanceStatus.Completed, instance.NormalProgress); Assert.IsNotNull(instance.ToString()); Assert.IsNotNull(instance.Bosses[0].ToString()); }
public void TestCharacterAllFields() { var client = new WowClient(TestConstants.TestRegionName, TestConstants.Credentials, null, null); var character = client.GetCharacterAsync(TestConstants.TestRealmName, TestConstants.TestCharacterName, CharacterFields.All).Result; Assert.IsNotNull(character); Assert.IsNotNull(character.Professions); Assert.IsNotNull(character.Achievements); Assert.IsNotNull(character.Items); Assert.IsNotNull(character.Titles); Assert.IsNotNull(character.Mounts); Assert.IsNotNull(character.Pets); Assert.IsNotNull(character.PetSlots); Assert.IsNotNull(character.Guild); Assert.IsNotNull(character.Progression); Assert.IsNotNull(character.Appearance); Assert.IsNotNull(character.Pvp); Assert.IsNotNull(character.CompletedQuestIds); Assert.IsNotNull(character.Reputations); Assert.IsNotNull(character.Stats); Assert.IsNotNull(character.Talents); Assert.IsNotNull(character.Statistics); Assert.AreEqual(character.Class, TestConstants.TestClass); Assert.IsTrue(character.Level >= 85); Assert.AreEqual(character.Race, TestConstants.TestRace); Assert.IsTrue(character.AchievementPoints > 0); Assert.AreEqual(character.Gender, TestConstants.TestGender); Assert.AreEqual(character.Realm, TestConstants.TestRealmName, true); Assert.AreEqual(character.Name, TestConstants.TestCharacterName, true); }
public void TestRealmsAsync() { var client = new WowClient(TestConstants.TestRegionName, null, null, null); var task = client.GetRealmStatusAsync(); RealmStatusResponse response = task.Result; Assert.IsNotNull(response); Assert.IsTrue(new RealmStatusResponse().ToString().Contains('0')); Assert.IsNotNull(response.ToString()); Assert.IsNotNull(response.Realms); Assert.IsTrue(response.Realms.Count > 0); Assert.IsTrue(response.Realms.Any(r => r.IsPvp)); Assert.IsTrue(response.Realms.Any(r => r.IsRP)); Assert.IsTrue(response.Realms.All(r => r.Locale != null)); Assert.IsTrue(response.Realms.All(r => r.Name != null)); Assert.IsTrue(!response.Realms.Any(r => r.ToString() == null)); Assert.IsTrue(response.Realms.All(r => r.Slug != null)); Assert.IsTrue(response.Realms.All(r => r.BattleGroupName != null)); Assert.IsTrue(response.Realms.Any(r => r.Status)); Assert.IsTrue(response.Realms.All(r => r.TimeZone != null)); Assert.IsTrue(response.Realms.Any(r => r.WinterGrasp != null)); var tolBarad = response.Realms.Where(r => r.TolBarad != null && r.Status).Select(r => r.TolBarad).FirstOrDefault(); Assert.IsNotNull(tolBarad); Assert.IsTrue(tolBarad.AreaId > 0); Assert.IsTrue(tolBarad.ControllingFaction != Faction.Neutral); Assert.IsTrue(tolBarad.NextBattleTimeUtc.Year == DateTime.Now.Year); Assert.IsTrue(tolBarad.Status != PvpZoneStatus.Unknown); }
public void TestItemCategories() { var client = new WowClient(TestConstants.TestRegion, "en-gb"); var result = client.GetItemCategoryNamesAsync().Result; Assert.IsNotNull(result); Assert.IsNotNull(result.CategoryNames); Assert.IsTrue(result.CategoryNames.Count > 0); foreach (var cat in result.CategoryNames) { Assert.IsNotNull(cat.Name); Assert.IsTrue((int)cat.Category >= 0); Assert.IsNotNull(cat.ToString()); if (cat.Subcategories != null) { foreach (var sub in cat.Subcategories) { Assert.IsNotNull(sub.Name); Assert.IsTrue(sub.SubcategoryId >= 0); Assert.IsNotNull(sub.ToString()); } } } }
public void TestCharacter() { var client = new WowClient(TestConstants.TestRegionName, TestConstants.Credentials, null, null); var character = client.GetCharacterAsync(TestConstants.TestRealmName, TestConstants.TestCharacterName, CharacterFields.All).Result; Assert.IsNotNull(character); Assert.IsNotNull(character.Professions); Assert.IsNotNull(character.Achievements); Assert.IsNotNull(character.Items); Assert.IsNotNull(character.Titles); Assert.IsNotNull(character.Mounts); Assert.IsNotNull(character.Pets); Assert.IsNotNull(character.PetSlots); //Assert.IsNotNull(character.HunterPets); Assert.IsNotNull(character.Feed); Assert.IsNotNull(character.Guild); Assert.IsNotNull(character.Progression); Assert.IsTrue(character.Class == ClassKey.Druid); Assert.IsTrue(character.Level >= 85); Assert.IsTrue(string.Equals(character.Realm, TestConstants.TestRealmName, StringComparison.OrdinalIgnoreCase)); Assert.IsTrue(string.Equals(character.Name, TestConstants.TestCharacterName, StringComparison.OrdinalIgnoreCase)); Assert.IsNotNull(character.Thumbnail); }
/// <summary> /// Fills the realm list auto complete box /// </summary> /// <param name="sender"> </param> /// <param name="e"> </param> private async void RegionComboSelectionChanged(object sender, SelectionChangedEventArgs e) { var client = new WowClient((Region)RegionCombo.SelectedValue); var result = await client.GetRealmStatusAsync(); RealmNameText.ItemsSource = result.Realms.Select(realm => realm.Name); }
public void TestRewards() { var client = new WowClient(TestConstants.TestRegionName, TestConstants.Credentials, null, null); 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.AreEqual(result.Rewards[0].RewardItem.Quality, ItemQuality.Heirloom); Assert.IsNotNull(result.Rewards[0].RewardItem.TooltipParameters); Assert.IsNotNull(result.Rewards[0].Achievement); var rw = new GuildReward(); // ReSharper disable ReturnValueOfPureMethodIsNotUsed rw.ToString(); // ReSharper restore ReturnValueOfPureMethodIsNotUsed }
public void TestGuildAchievements() { var client = new WowClient(TestConstants.TestRegion, Properties.Settings.Default.PublicKey, TestConstants.TestLocale); var result = client.GetGuildAchievementsAsync().Result; Assert.IsNotNull(result); }
public void TestCharacterGear() { var client = new WowClient(TestConstants.TestRegionName, TestConstants.Credentials, null, null); var character = client.GetCharacterAsync(TestConstants.TestRealmName, TestConstants.TestCharacterName, CharacterFields.Items).Result; Assert.IsNotNull(character); Assert.IsNotNull(character.Items); Assert.IsNotNull(character.Items.ToString()); Assert.AreSame(character.Items.Head, character.Items[EquipmentSlot.Head]); Assert.AreSame(character.Items.Neck, character.Items[EquipmentSlot.Neck]); Assert.AreSame(character.Items.Shoulder, character.Items[EquipmentSlot.Shoulder]); Assert.AreSame(character.Items.Back, character.Items[EquipmentSlot.Back]); Assert.AreSame(character.Items.Chest, character.Items[EquipmentSlot.Chest]); Assert.AreSame(character.Items.Tabard, character.Items[EquipmentSlot.Tabard]); Assert.AreSame(character.Items.Shirt, character.Items[EquipmentSlot.Shirt]); Assert.AreSame(character.Items.Wrist, character.Items[EquipmentSlot.Wrist]); Assert.AreSame(character.Items.Hands, character.Items[EquipmentSlot.Hands]); Assert.AreSame(character.Items.Waist, character.Items[EquipmentSlot.Waist]); Assert.AreSame(character.Items.Legs, character.Items[EquipmentSlot.Legs]); Assert.AreSame(character.Items.Feet, character.Items[EquipmentSlot.Feet]); Assert.AreSame(character.Items.Finger1, character.Items[EquipmentSlot.Finger1]); Assert.AreSame(character.Items.Finger2, character.Items[EquipmentSlot.Finger2]); Assert.AreSame(character.Items.Trinket1, character.Items[EquipmentSlot.Trinket1]); Assert.AreSame(character.Items.Trinket2, character.Items[EquipmentSlot.Trinket2]); Assert.AreSame(character.Items.Offhand, character.Items[EquipmentSlot.Offhand]); Assert.AreSame(character.Items.MainHand, character.Items[EquipmentSlot.MainHand]); var item = character.Items.AllItems.First(); Assert.IsNotNull(item); Assert.IsNotNull(item.Name); Assert.IsTrue(item.ItemId > 0); Assert.IsNotNull(item.Icon); Assert.AreEqual(item.Name, item.ToString()); item = character.Items.Chest; Assert.IsNotNull(item.Parameters); Assert.IsTrue(item.Parameters.Enchant.HasValue); Assert.IsTrue(item.Parameters.Enchant.Value > 0); Assert.IsTrue(item.Parameters.Gem0.HasValue); Assert.IsTrue(item.Parameters.Gem0.Value > 0); //Assert.IsTrue(item.Parameters.Gem1.HasValue); //Assert.IsTrue(item.Parameters.Gem1.Value > 0); //Assert.IsTrue(item.Parameters.Gem2.HasValue); //Assert.IsTrue(item.Parameters.Gem2.Value > 0); //Assert.IsFalse(item.Parameters.Gem3.HasValue); Assert.IsTrue((int)item.Quality >= (int)ItemQuality.Rare); //Assert.IsNotNull(item.Parameters.SetItems); //Assert.IsTrue(item.Parameters.SetItems.Count > 0); //Assert.IsTrue(item.Parameters.TransmogrifyItemId.HasValue); //Assert.IsTrue(item.Parameters.TransmogrifyItemId.Value > 0); Assert.IsFalse(item.Parameters.Tinker.HasValue); var ritem = character.Items.AllItems.Any(i => i.Parameters.Reforge.HasValue); Assert.IsTrue(ritem); }
public void TestSpell() { var client = new WowClient(TestConstants.TestRegion, TestConstants.Credentials, null, null); var spell = client.GetSpellAsync(8056).Result; Assert.IsNotNull(spell); Assert.IsNotNull(spell.Name); }
public void TestRealms() { var client = new WowClient(TestConstants.TestRegionName, TestConstants.Credentials, null, null); var realms = client.GetRealmStatusAsync(null).Result; realms = client.GetRealmStatusAsync(new[] { TestConstants.TestRealmName }).Result; Assert.AreEqual(1, realms.Realms.Count); }
public void TestCacheNoFail() { var client = new WowClient(TestConstants.TestRegion, null, new MockupCache(false, false)); var item1 = client.GetItemAsync(49110).Result; var item2 = client.GetItemAsync(49110).Result; Assert.AreSame(item1, item2); }
public void TestClasses() { var client = new WowClient(TestConstants.TestRegion, Properties.Settings.Default.PublicKey, TestConstants.TestLocale); var classes = client.GetClassesAsync().Result; Assert.IsNotNull(classes); Assert.IsTrue(classes.Count > 0); }
public void TestItemClasses() { var client = new WowClient(TestConstants.TestRegion, Properties.Settings.Default.PublicKey, TestConstants.TestLocale); var result = client.GetItemCategoryNamesAsync().Result; Assert.IsNotNull(result); Assert.IsNotNull(result.CategoryNames); Assert.IsNotNull(result.CategoryNames.Count > 0); }
public void TestItemCategoryNames() { var client = new WowClient(TestConstants.TestRegionName, TestConstants.Credentials, null, null); var result = client.GetItemCategoryNamesAsync().Result; Assert.IsNotNull(result); Assert.IsNotNull(result.CategoryNames); Assert.IsNotNull(result.CategoryNames.Count > 0); }
public void TestBag() { const int id = 38082; // "Gigantique" Bag var client = new WowClient(TestConstants.TestRegion, "en-gb"); var item = client.GetItemAsync(id).Result; Assert.AreEqual(22, item.ContainerSlots); }
public void TestChallengeMode() { var client = new WowClient(TestConstants.TestRegion, Properties.Settings.Default.PublicKey, TestConstants.TestLocale); var challengeMode = client.GetChallengeLeadersAsync(TestConstants.TestRealmName).Result; Assert.IsNotNull(challengeMode); challengeMode = client.GetChallengeLeadersAsync(string.Empty).Result; Assert.IsNotNull(challengeMode); }
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); }
public void TestBattlePetTypes() { var client = new WowClient(TestConstants.TestRegion, TestConstants.Credentials, null, null); var types = client.GetBattlePetTypesAsync().Result; Assert.IsNotNull(types); Assert.IsNotNull(types.PetTypes); Assert.AreNotEqual(0, types.PetTypes.Count); Assert.IsTrue(types.PetTypes.All(pt => pt.Name != null)); }
public void TestBattlePetSpecies() { var client = new WowClient(TestConstants.TestRegion, TestConstants.Credentials, null, null); var species = client.GetBattlePetSpeciesAsync(258).Result; Assert.IsNotNull(species); Assert.IsNotNull(species.Description); Assert.AreEqual(258, species.SpeciesId); Assert.IsNotNull(species.Icon); }
public void TestBattlePetAbility() { var client = new WowClient(TestConstants.TestRegion, TestConstants.Credentials, null, null); var ability = client.GetBattlePetAbilityAsync(640).Result; Assert.IsNotNull(ability); Assert.IsNotNull(ability.Name); Assert.AreEqual(ability.Id, 640); Assert.IsNotNull(ability.Icon); }
public void TestUniqueTabard() { const int id = 31781; // Sha'tar Tabard var client = new WowClient(TestConstants.TestRegion, "en-gb"); var item = client.GetItemAsync(id).Result; Assert.IsTrue(item.MaxCount > 0); Assert.IsTrue(item.MinimumFactionId > 0); Assert.IsTrue(item.MinimumFactionStanding == Standing.Exalted); }
public void TestRecipe() { var client = new WowClient(TestConstants.TestRegion, Properties.Settings.Default.PublicKey, TestConstants.TestLocale); var recipe = client.GetRecipeAsync(TestConstants.WowTestRecipeId).Result; Assert.IsNotNull(recipe); Assert.IsNotNull(recipe.Name); Assert.IsNotNull(recipe.ToString()); Assert.IsNotNull(recipe.ProfessionName); Assert.IsNotNull(recipe.Icon); Assert.IsTrue(recipe.Id > 0); }
public void TestCharacterCompanions() { var client = new WowClient(TestConstants.TestRegionName, TestConstants.Credentials, null, null); var character = client.GetCharacterAsync(TestConstants.TestRealmName, TestConstants.TestCharacterName, CharacterFields.Pets).Result; Assert.IsNotNull(character.Pets); Assert.IsNotNull(character.Pets.Collected); Assert.AreNotEqual(character.Pets.CollectedCount, 0); Assert.AreNotEqual(character.Pets.NotCollectedCount, 0); Assert.AreEqual(character.Pets.CollectedCount, character.Pets.Collected.Count); }