Beispiel #1
0
        public void findWinningTrump_robotHasNoTrumps_returnsNone()
        {
            var hc = new contractWhist2.Controllers.HomeController();

            //Arrange
            var myPlayer = new player(1);

            addGenericCardList(myPlayer);
            hc.trumpcard    = "2D";
            hc.winningTrump = new card("JD");

            //Act
            card winningTrump = hc.findWinningTrump(myPlayer);

            //Assert
            Assert.That(winningTrump.name == "NONE");
        }
Beispiel #2
0
        public void findWinningTrump_robotCanOverTrump_returnsLowestOvertrump()
        {
            var hc = new contractWhist2.Controllers.HomeController();

            //Arrange
            var myPlayer = new player(1);

            addGenericCardList(myPlayer);
            hc.trumpcard    = "2H";
            hc.winningTrump = new card("8H");

            //Act
            card winningTrump = hc.findWinningTrump(myPlayer);

            //Assert
            Assert.That(winningTrump.name == "9H");
        }
Beispiel #3
0
        public void findWinningTrump_robotCannotOverTrump_returnsNone()
        {
            var hc = new contractWhist2.Controllers.HomeController();

            //Arrange
            var myPlayer = new player(1);

            addGenericCardList(myPlayer);
            hc.trumpcard    = "2H";
            hc.winningTrump = new card("JH");

            //Act
            card winningTrump = hc.findWinningTrump(myPlayer);

            //Assert
            Assert.AreEqual(winningTrump.name, "NONE");
        }
Beispiel #4
0
        public void findWinningTrump_noTrumpPlayed_returnsLowestTrump()
        {
            var hc = new contractWhist2.Controllers.HomeController();

            //Arrange
            var myPlayer = new player(1);

            addGenericCardList(myPlayer);
            hc.trumpcard = "2H";
//            hc.winningTrump = new card("JD");

            //Act

            card winningTrump = hc.findWinningTrump(myPlayer);

            //Assert
            Assert.AreEqual(winningTrump.name, "3H");
        }