public void Trick_StartingPlayer_FirstTrick() { var player1 = new Mock <IPlayer>(); var player4 = new Mock <IPlayer>(); var mockNewTrick = new Mock <ITrick>(); var trickList = new List <ITrick>() { mockNewTrick.Object }; var mockHand = new Mock <IHand>(); mockHand.Setup(m => m.StartingPlayer).Returns(player1.Object); mockHand.Setup(m => m.ITricks).Returns(trickList); var startingPlayer = new StartingPlayerCalculator().GetStartingPlayer(mockHand.Object, mockNewTrick.Object); Assert.AreEqual(player1.Object, startingPlayer, "The starting player for first trick should be the same as the starting player for the hand."); }
public void Trick_StartingPlayer_SecondTrick() { var player1 = new Mock <IPlayer>(); var player4 = new Mock <IPlayer>(); var mockNewTrick = new Mock <ITrick>(); var mockCompleteTrick = new Mock <ITrick>(); mockCompleteTrick.Setup(m => m.Winner()).Returns(new TrickWinner() { Player = player4.Object, Points = 94 }); var trickList = new List <ITrick>() { mockCompleteTrick.Object, mockNewTrick.Object }; var mockHand = new Mock <IHand>(); mockHand.Setup(m => m.StartingPlayer).Returns(player1.Object); mockHand.Setup(m => m.ITricks).Returns(trickList); var startingPlayer = new StartingPlayerCalculator().GetStartingPlayer(mockHand.Object, mockNewTrick.Object); Assert.AreEqual(player4.Object, startingPlayer, "The starting player for the second trick should be the winner of the previous trick."); }