private void AddPointsToWinner(ICardsPlayedResponse cardsPlayedResponse) { if (cardsPlayedResponse.Result == Enums.CardResponseResult.Win) { cardsPlayedResponse.Winner.Points++; } }
public ICardsPlayedResponse PersonsCardsPlayed(IEnumerable <IPersonCard> cards) { ICardsPlayedResponse cardsPlayedResponse = personCardGameService.ChooseWinnerCard(cards); AddPointsToWinner(cardsPlayedResponse); return(cardsPlayedResponse); }
public ICardsPlayedResponse SpaceShipCardsPlayed(IEnumerable <ISpaceshipCard> cards) { ICardsPlayedResponse cardsPlayedResponse = spaceshipCardGameService.ChooseWinnerCard(cards); AddPointsToWinner(cardsPlayedResponse); return(cardsPlayedResponse); }
public void SpaceShipsCardsPlayed(List <ISpaceshipCard> cards, ICardsPlayedResponse desiredResponse) { //TODO: Validate points var response = _cardGameController.SpaceShipCardsPlayed(cards); Assert.IsTrue(response.Equals(desiredResponse)); }
public void PersonsCardsPlayed(List <IPersonCard> cards, ICardsPlayedResponse desiredResponse) { //TODO: Validate points var response = _cardGameController.PersonsCardsPlayed(cards); Assert.IsTrue(response.Equals(desiredResponse)); }
public override bool Equals(object obj) { ICardsPlayedResponse cardResponseObject = obj as ICardsPlayedResponse; if (cardResponseObject == null) { return(false); } return(Winner == cardResponseObject.Winner && Result == cardResponseObject.Result); }
public void ChooseWinnerSpaceshipCard(List <ISpaceshipCard> cards, ICardsPlayedResponse desiredResponse) { ICardsPlayedResponse winnerCardfromService = spaceshipCardGameService.ChooseWinnerCard(cards); Assert.AreEqual(winnerCardfromService, desiredResponse); }
public void ChooseWinnerPersonCard(List <IPersonCard> cards, ICardsPlayedResponse desiredResponse) { ICardsPlayedResponse cardsPlayedResponse = personCardGameService.ChooseWinnerCard(cards); Assert.AreEqual(cardsPlayedResponse, desiredResponse); }