Esempio n. 1
0
        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));
        }
Esempio n. 2
0
        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));
        }
Esempio n. 3
0
        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"));
        }
Esempio n. 4
0
        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));
        }