public void HearthBuilder() { Deck expected = CreateDeck("Inner Rage;0", "Commanding Shout;1", "Cruel Taskmaster;2", "Dread Corsair;2", "Armorsmith;0"); Deck found = DeckImporter.Import(@"http://www.hearthbuilder.com/decks/senfglas-1-legend-grim-patron-warrior").Result; Assert.IsTrue(AreDecksEqual(expected, found)); }
public void Hearthstats() { Deck expected = CreateDeck(); Deck found = DeckImporter.Import(@"https://hearthstats.net/decks/senfglas-patron--248").Result; Assert.IsTrue(AreDecksEqual(expected, found)); }
public void HearthpwnDeckBuilder() { Deck expected = CreateDeck(); Deck found = DeckImporter.Import(@"http://www.hearthpwn.com/deckbuilder/warrior#69:2;161:2;193:2;215:2;227:2;246:2;261:1;328:1;366:1;428:2;632:2;644:2;664:2;7734:2;7757:2;14435:2;14454:1").Result; Assert.IsTrue(AreDecksEqual(expected, found)); }
public void EliteDecks() { Deck expected = CreateDeck("Inner Rage;2", "Loot Hoarder;2", "Cruel Taskmaster;0", "Gnomish Inventor;0"); Deck found = DeckImporter.Import(@"http://www.elitedecks.net/deck-7918-patron-warrior").Result; Assert.IsTrue(AreDecksEqual(expected, found)); }
public void IcyVeins() { Deck expected = CreateDeck("Inner Rage;2", "Fiery War Axe;1", "Shield Block;2", "Dread Corsair;0", "Cruel Taskmaster;0"); Deck found = DeckImporter.Import(@"http://www.icy-veins.com/hearthstone/low-budget-warrior-grim-patron-otk-one-turn-kill-brm-deck").Result; Assert.IsTrue(AreDecksEqual(expected, found)); }
public void HearthstoneTopDeck() { Deck expected = CreateDeck(); Deck found = DeckImporter.Import(@"http://www.hearthstonetopdeck.com/deck/4700/current/otk-patron-senfglas-lifecoach").Result; Assert.IsTrue(AreDecksEqual(expected, found)); }
public void HearthstoneDecksFR() { Deck expected = CreateDeck("Inner Rage;0", "Cruel Taskmaster;2", "Slam;0", "Grommash Hellscream;1", "Loot Hoarder;2", "Unstable Ghoul;0", "Dr. Boom;1"); Deck found = DeckImporter.Import(@"http://www.hearthstone-decks.com/deck/voir/grim-patron-by-sjow-3163").Result; Assert.IsTrue(AreDecksEqual(expected, found)); }
public void TempoStorm() { Deck expected = CreateDeck(); Deck found = DeckImporter.Import(@"https://tempostorm.com/hearthstone/decks/senfglas-patron").Result; Assert.IsTrue(AreDecksEqual(expected, found)); }
public void HearthstoneHerosDE() { Deck expected = CreateDeck("Commanding Shout;1", "Unstable Ghoul;1", "Gnomish Inventor;1", "Dread Corsair;2"); Deck found = DeckImporter.Import(@"http://www.hearthstoneheroes.de/decks/grim-patron-oder-grimmiger-gast-von-trump-inspiriert/").Result; Assert.IsTrue(AreDecksEqual(expected, found)); }
public void HearthnewsFR() { Deck expected = CreateDeck("Inner Rage;0", "Commanding Shout;1", "Cruel Taskmaster;2", "Dread Corsair;2", "Armorsmith;0"); Deck found = DeckImporter.Import(@"http://www.hearthnews.fr/decks/4620").Result; Assert.IsTrue(AreDecksEqual(expected, found)); }
public void Hearthpwn() { Deck expected = CreateDeck(); Deck found = DeckImporter.Import(@"http://www.hearthpwn.com/decks/267064-grim-patron-senfglas").Result; Assert.IsTrue(AreDecksEqual(expected, found)); }
public void HearthstoneTopDecks() { Deck expected = CreateDeck(); Deck found = DeckImporter.Import(@"http://www.hearthstonetopdecks.com/decks/lifecoachs-archon-league-w-1-patron-warrior/").Result; Assert.IsTrue(AreDecksEqual(expected, found)); }
public void HearthstonePlayers() { Deck expected = CreateDeck(); Deck found = DeckImporter.Import(@"http://hearthstoneplayers.com/shengs-budget-patron-warrior-deck/").Result; Assert.IsTrue(AreDecksEqual(expected, found)); }
public void Hearthhead() { Deck expected = CreateDeck("Inner Rage;0", "Commanding Shout;1", "Cruel Taskmaster;2", "Dread Corsair;2", "Armorsmith;0"); Deck found = DeckImporter.Import(@"http://www.hearthhead.com/deck=104740/forsen-senfglas").Result; Assert.IsTrue(AreDecksEqual(expected, found)); }
public void Hearthpwn() { Deck expected = CreateDeck(); Deck found = DeckImporter.Import(@"http://www.hearthpwn.com/decks/274631-senfglas-1-legend-grim-patron-warrior-1074").Result; Assert.IsTrue(AreDecksEqual(expected, found)); }
public void ManaCrystals() { Deck expected = CreateDeck("Inner Rage;2", "Shield Slam;2", "Grommash Hellscream;1", "Piloted Shredder;2", "Dr. Boom;1", "Warsong Commander;0", "Slam;0", "Gnomish Inventor;0", "Emperor Thaurissan;0"); Deck found = DeckImporter.Import(@"https://manacrystals.com/decklists/172-zalae-s-patron-warrior").Result; Assert.IsTrue(AreDecksEqual(expected, found)); }
private async Task <ImportingResult> ImportDeckFromUrl(string url = null, bool checkClipboard = true) { var fromClipboard = false; if (url == null) { if (checkClipboard) { try { var clipboard = Clipboard.ContainsText() ? new string(Clipboard.GetText().Take(1000).ToArray()) : ""; if (Helper.IsValidUrl(clipboard)) { url = clipboard; fromClipboard = true; } } catch (Exception e) { Log.Error(e); } } if (url == null) { url = await InputDeckUrl(); } } if (url == null) { return new ImportingResult { WasCancelled = true } } ; var controller = await this.ShowProgressAsync("Loading Deck", "Please wait..."); var deck = await DeckImporter.Import(url); if (deck != null && string.IsNullOrEmpty(deck.Url)) { deck.Url = url; } await controller.CloseAsync(); if (deck == null && fromClipboard) { return(await ImportDeckFromUrl(checkClipboard : false)); } return(new ImportingResult { Deck = deck, Url = url }); }
private async Task <Deck> ImportDeckFromURL(string url) { var controller = await this.ShowProgressAsync("Loading Deck...", "please wait"); var deck = await DeckImporter.Import(url); if (deck != null) { deck.Url = url; } await controller.CloseAsync(); return(deck); }
internal async void BtnUpdateDeck_Click(object sender, RoutedEventArgs e) { var selectedDeck = DeckPickerList.SelectedDecks.FirstOrDefault(); if (string.IsNullOrEmpty(selectedDeck?.Url)) { return; } var deck = await DeckImporter.Import(selectedDeck.Url); if (deck == null) { await this.ShowMessageAsync("Error", "Could not load deck from specified url."); return; } //this could be expanded to check against the last version of the deck that was not modified after downloading if (deck.Cards.All(c1 => selectedDeck.GetSelectedDeckVersion().Cards.Any(c2 => c1.Name == c2.Name && c1.Count == c2.Count)) && deck.Name == selectedDeck.Name) { await this.ShowMessageAsync("Already up to date.", "No changes found."); return; } SetNewDeck(selectedDeck, true); TextBoxDeckName.Text = deck.Name; _newDeck.Cards.Clear(); foreach (var card in deck.Cards) { _newDeck.Cards.Add(card); } _newDeck.Edited(); UpdateCardCount(); Helper.SortCardCollection(ListViewDeck.Items, Config.Instance.CardSortingClassFirst); ManaCurveMyDecks.UpdateValues(); TagControlEdit.SetSelectedTags(deck.Tags); }
internal async void UpdateDeckFromWeb(Deck existingDeck) { if (existingDeck == null || string.IsNullOrEmpty(existingDeck.Url)) { return; } var deck = await DeckImporter.Import(existingDeck.Url); if (deck == null) { await this.ShowMessageAsync("Error", "Could not load deck from specified url."); return; } //this could be expanded to check against the last version of the deck that was not modified after downloading if (deck.Cards.All(c1 => existingDeck.GetSelectedDeckVersion().Cards.Any(c2 => c1.Name == c2.Name && c1.Count == c2.Count)) && deck.Name == existingDeck.Name) { await this.ShowMessageAsync("Already up to date.", "No changes found."); return; } var imported = (Deck)existingDeck.Clone(); imported.Name = deck.Name; imported.Cards.Clear(); foreach (var card in deck.Cards) { imported.Cards.Add(card); } ShowDeckEditorFlyout(imported, false); Helper.SortCardCollection(ListViewDeck.Items, Config.Instance.CardSortingClassFirst); ManaCurveMyDecks.UpdateValues(); TagControlEdit.SetSelectedTags(deck.Tags); }
public void InvalidUrlTest() { var found = DeckImporter.Import(@"http://hsdecktracker.net").Result; Assert.IsNull(found); }
public void HearthArena() { Deck found = DeckImporter.Import(@"http://www.heartharena.com/arena-run/i2s8ht").Result; Assert.IsTrue(AreDecksEqual(arena, found)); }