public void Parse_CorrectHandInputWithSpacesBeforeAndAfterString_HandIsParsedCorrectly()
        {
            //Expected
            List <string> expectedHand = new List <string> {
                "2H", "3D", "10S", "9C", "13D"
            };
            string input = " 2H 3D TS 9C KD ";

            //Actual
            var actualHand = PlayerHandParser.Parse(input);

            //Assert
            for (short i = 0; i < expectedHand.Count; i++)
            {
                Assert.Equal(expectedHand[i], actualHand[i]);
            }
            Assert.NotNull(actualHand);
            Assert.Equal(expectedHand.Count, actualHand.Count);
        }
 public void Parse_BadHandInput_ThrowsException(string input)
 {
     Assert.Throws <ArgumentException>(() => PlayerHandParser.Parse(input));
 }
Exemplo n.º 3
0
 public Player(string hand)
 {
     Hand = PlayerHandParser.Parse(hand);
 }