public void DeletePieceSuccess() { var msg2 = new Message <DeletePieceResponsePayload>() { Type = Common.Consts.DeletePieceResponse, SenderId = Common.Consts.GameMasterId, RecipientId = _assignedPlayerId }; _playerState.HeldPiece = new Piece() { IsSham = false };; _messageProvider.Setup(x => x.Receive <ActionValidPayload>()).Returns(new Message <ActionValidPayload>()); _messageProvider.Setup(x => x.Receive <DeletePieceResponsePayload>()).Returns(msg2); // ------------------------ var actionExecutor = new ActionExecutor(_messageProvider.Object, _playerState); var result = actionExecutor.DeletePiece(); // ------------------------ Assert.That(result, Is.True); Assert.That(_playerState.HeldPiece, Is.Null); }
public void DeletePieceActionInvalid() { _messageProvider.Setup(x => x.Receive <ActionValidPayload>()).Throws(new ActionInvalidException()); var actionExecutor = new ActionExecutor(_messageProvider.Object, _playerState); var result = actionExecutor.DeletePiece(); Assert.That(result, Is.False); }