/// <summary> /// Parses and verifies the card count of the deck filename. The filename must match /// those found in /DeckFiles/ /// </summary> /// <param name="deckFileName">The filename of the deck to verify</param> /// <param name="scratchDirectory">The directory to create the deck file in</param> /// <param name="game">The Game that should be chosen in the Wizard</param> public static void VerifyDeckFile( string deckFileName, IEnumerable <ExpectedDeckSection> expectedSectionsStats, string scratchDirectory, Octgn.DataNew.Entities.Game game) { Assert.IsTrue(DeckFileResourceHelpers.CopyDeckFileResourceToDirectory( scratchDirectory, deckFileName)); ConverterDeck converterDeck = ConvertDeckFileUsingWizard(Path.Combine(scratchDirectory, deckFileName), game); foreach (ConverterSection converterSection in converterDeck.ConverterSections) { ExpectedDeckSection expectedSectionStats = expectedSectionsStats.First(eds => eds.SectionName == converterSection.SectionName); Assert.AreEqual(expectedSectionStats.TotalCardCount, converterSection.SectionCount); Assert.AreEqual(expectedSectionStats.UniqueCardCount, converterSection.SectionMappings.Count(sm => sm.PotentialOCTGNCards.Count > 0)); foreach (ConverterMapping converterMapping in converterSection.SectionMappings) { // At least one potential match should have been found Assert.IsTrue(converterMapping.PotentialOCTGNCards.Count() > 0); } } }
private void CompareIdenticalDecksInDifferentFormats(IEnumerable <string> deckNameGroup) { List <OCTGNDeckConverter.Model.ConverterDeck> converterDeckGroup = new List <OCTGNDeckConverter.Model.ConverterDeck>(); foreach (string deckName in deckNameGroup) { DeckFileResourceHelpers.CopyDeckFileResourceToDirectory(this.TestContext.DeploymentDirectory, deckName); converterDeckGroup.Add(DeckFileResourceHelpers.ConvertDeckFileUsingWizard( Path.Combine(this.TestContext.DeploymentDirectory, deckName), MTG.mtgGame)); } DeckFileResourceHelpers.VerifyAllConverterDecksAreIdentical(converterDeckGroup); }