Пример #1
0
        public void ParseDeckShouldCorrectlyParseDesk()
        {
            // Act
            string deckCode = ArtifactDeckEncoder.EncodeDeck(TestDecks.GreenBlackExample);

            // Verify
            Assert.Equal(TestDeckCodes.GreenBlackExample, deckCode);
        }
Пример #2
0
        public void EncodeDeckThrowsForCardRefWithZeroId()
        {
            Deck deck = new Deck()
            {
                Cards = { new CardRef(0, 2) }
            };

            Assert.Throws <ArtifactDeckEncoderException>(() => ArtifactDeckEncoder.EncodeDeck(deck));
        }
Пример #3
0
        public void EncodeDeckThrowsForHeroRefWithZeroTurn()
        {
            Deck deck = new Deck()
            {
                Heroes = { new HeroRef(10024, 0) }
            };

            Assert.Throws <ArtifactDeckEncoderException>(() => ArtifactDeckEncoder.EncodeDeck(deck));
        }
        public void ArtifactDecksCanBeDecodedAndEncoded()
        {
            foreach (var inputDeckString in DeckStrings)
            {
                Deck   deck       = ArtifactDeckDecoder.DecodeDeck(inputDeckString);
                string deckString = ArtifactDeckEncoder.EncodeDeck(deck);

                Assert.Equal(inputDeckString, deckString);
            }
        }
Пример #5
0
        public void EncodeDeckAcceptsHeroRefWithZeroId()
        {
            Deck deck = new Deck()
            {
                Heroes = { new HeroRef(0, 1) }
            };

            // This should probably be an error, but for some reason it's not in Valve's reference implementation.
            string deckCode = ArtifactDeckEncoder.EncodeDeck(deck);

            Assert.NotNull(deckCode);
        }
Пример #6
0
        public void EncodeDeckTruncatesLongDeckNames()
        {
            Deck deckWithLongName = new Deck()
            {
                Name = "이것은 전 세계와 아마도 우주에서 최고의 카드 덱입니다"
            };
            Deck deckWithTruncatedName = new Deck()
            {
                Name = "이것은 전 세계와 아마도 우주에서 최고의 카드"
            };

            Assert.Equal(ArtifactDeckEncoder.EncodeDeck(deckWithTruncatedName), ArtifactDeckEncoder.EncodeDeck(deckWithLongName));
        }
Пример #7
0
        public void EncodeDeckCorrectlyEncodesDeck()
        {
            string deckCode = ArtifactDeckEncoder.EncodeDeck(TestDecks.GreenBlackExample);

            Assert.Equal(TestDeckCodes.GreenBlackExample, deckCode);
        }
Пример #8
0
 public void EncodeDeckThrowsWithNullInput()
 {
     Assert.Throws <ArgumentNullException>(() => ArtifactDeckEncoder.EncodeDeck(null));
 }