Ejemplo n.º 1
0
        public void TestCardTurnOver()
        {
            Card c = new Card(Rank.ACE, Suit.DIAMOND);

            Assert.AreEqual("**", c.ToString());
            c.TurnOver();
            Assert.AreEqual("AD", c.ToString());
            c.TurnOver();
            Assert.AreEqual("**", c.ToString());

            c = new Card(Rank.FOUR, Suit.HEART);
            Assert.AreEqual("**", c.ToString());
            c.TurnOver();
            Assert.AreEqual("4H", c.ToString());
        }
Ejemplo n.º 2
0
        public void TestCardIndex()
        {
            Card c = new Card(Rank.ACE, Suit.SPADE);

            Assert.AreEqual(52, c.CardIndex);
            c.TurnOver();
            Assert.AreEqual(0, c.CardIndex);

            c = new Card(Rank.KING, Suit.CLUB);
            Assert.AreEqual(52, c.CardIndex);
            c.TurnOver();
            Assert.AreEqual(51, c.CardIndex);
        }
Ejemplo n.º 3
0
        public void TestCardCreation()
        {
            Card c = new Card(Rank.KING, Suit.HEART);

            c.TurnOver();
            Assert.AreEqual(Rank.KING, c.Rank);
            Assert.AreEqual(Suit.HEART, c.Suit);

            c = new Card(Rank.TWO, Suit.DIAMOND);
            c.TurnOver();
            Assert.AreEqual(Rank.TWO, c.Rank);
            Assert.AreEqual(Suit.DIAMOND, c.Suit);
        }
Ejemplo n.º 4
0
        public void TestCardToString()
        {
            Card c = new Card(Rank.ACE, Suit.SPADE);

            c.TurnOver();
            Assert.AreEqual("AS", c.ToString());

            c = new Card(Rank.TEN, Suit.CLUB);
            c.TurnOver();
            Assert.AreEqual("TC", c.ToString());

            c = new Card(Rank.THREE, Suit.DIAMOND);
            c.TurnOver();
            Assert.AreEqual("3D", c.ToString());

            c = new Card(Rank.JACK, Suit.HEART);
            c.TurnOver();
            Assert.AreEqual("JH", c.ToString());
        }
Ejemplo n.º 5
0
        public void TestCardTurnOver()
        {
            Card c = new Card(Rank.ACE, Suit.DIAMOND);
            Assert.AreEqual ("**", c.ToString ());
            c.TurnOver();
            Assert.AreEqual ("AD", c.ToString ());
            c.TurnOver();
            Assert.AreEqual ("**", c.ToString ());

            c = new Card(Rank.FOUR, Suit.HEART);
            Assert.AreEqual ("**", c.ToString ());
            c.TurnOver();
            Assert.AreEqual ("4H", c.ToString ());
        }
Ejemplo n.º 6
0
        public void TestCardToString()
        {
            Card c = new Card (Rank.ACE, Suit.SPADE);
            c.TurnOver();
            Assert.AreEqual ("AS", c.ToString ());

            c = new Card (Rank.TEN, Suit.CLUB);
            c.TurnOver();
            Assert.AreEqual ("TC", c.ToString ());

            c = new Card (Rank.THREE, Suit.DIAMOND);
            c.TurnOver();
            Assert.AreEqual ("3D", c.ToString ());

            c = new Card (Rank.JACK, Suit.HEART);
            c.TurnOver();
            Assert.AreEqual ("JH", c.ToString ());
        }
Ejemplo n.º 7
0
        public void TestCardIndex()
        {
            Card c = new Card (Rank.ACE, Suit.SPADE);
            Assert.AreEqual (52, c.CardIndex);
            c.TurnOver();
            Assert.AreEqual (0, c.CardIndex);

            c = new Card (Rank.KING, Suit.CLUB);
            Assert.AreEqual (52, c.CardIndex);
            c.TurnOver();
            Assert.AreEqual (51, c.CardIndex);
        }
Ejemplo n.º 8
0
        public void TestCardCreation()
        {
            Card c = new Card (Rank.KING, Suit.HEART);
            c.TurnOver();
            Assert.AreEqual (Rank.KING, c.Rank);
            Assert.AreEqual (Suit.HEART, c.Suit);

            c = new Card (Rank.TWO, Suit.DIAMOND);
            c.TurnOver();
            Assert.AreEqual (Rank.TWO, c.Rank);
            Assert.AreEqual (Suit.DIAMOND, c.Suit);
        }