public void TcgPlayerCsvFormatter_parses_count([Values(1, 2, 3, 4, 20)] int cardCount) { var deckFormatter = new TcgCsvDeckFormatter(Repo); string csvContent = TcgCsvHeader + TcgCsvRowDelimiter + Regex.Replace(_tcgCsvCards[0], @"^\d+(?=,)", cardCount.ToString()); Deck deck = deckFormatter.ImportDeck(csvContent); Assert.That(deck.MainDeck.Count.Values.Single(), Is.EqualTo(cardCount)); }
public void TcgPlayerCsvFormatter_matches_multiple_cards([Values(2, 5)] int rowsCount) { var deckFormatter = new TcgCsvDeckFormatter(Repo); // Test file to Parse. File generated by TCG Player mobile card scanning app: string csvContent = TcgCsvHeader + TcgCsvRowDelimiter + string.Join(TcgCsvRowDelimiter, _tcgCsvCards.Take(rowsCount)); Deck deck = deckFormatter.ImportDeck(csvContent); Assert.That(deck.MainDeck.Order.Count, Is.EqualTo(rowsCount)); }
public void TcgPlayerCsvFormatter_matches_set() { var deckFormatter = new TcgCsvDeckFormatter(Repo); string csvContent = TcgCsvHeader + TcgCsvRowDelimiter + _tcgCsvCards[0]; Deck deck = deckFormatter.ImportDeck(csvContent); var matchedCard = Repo.CardsById[deck.MainDeck.Order[0]]; Assert.That(matchedCard.SetCode, Is.EqualTo("ELD")); }
public void TcgPlayerCsvFormatter_matches_cards([ValueSource(nameof(_tcgCsvCards))] string cardRow) { var deckFormatter = new TcgCsvDeckFormatter(Repo); // Test file to Parse. File generated by TCG Player mobile card scanning app: string csvContent = TcgCsvHeader + TcgCsvRowDelimiter + cardRow; Deck deck = deckFormatter.ImportDeck(csvContent); Assert.That(deck.MainDeck.Order.Count, Is.EqualTo(1)); }