public void ThenThrowsInvalidSessionIDException(string invalidInput) { AwaitingResponseGatewaySpy spy = new AwaitingResponseGatewaySpy(false); Assert.Throws <InvalidSessionIDException>(() => new GameSessionNotFound(new GetStartingCardDummy(), spy).Execute( invalidInput, "Message ID")); }
public void ThenThrowsInvalidSessionIDException(string invalidInput) { AwaitingResponseGatewaySpy spy = new AwaitingResponseGatewaySpy(false); IGetGameInProgress getGameInProgressDummy = new GetGameInProgressDummy(); Assert.Throws <InvalidSessionIDException>(() => new GameSessionFound(getGameInProgressDummy, spy).Execute(invalidInput, "Message ID")); }
public void ThenNewMessageIdIsAddedToAwaitingResponseGateway() { GenerateSeedStub stub = new GenerateSeedStub(0); PublishEndPointSpy publishEndPointSpy = new PublishEndPointSpy(); AwaitingResponseGatewaySpy spy = new AwaitingResponseGatewaySpy(true); new GetStartingCard(new PackVersionGatewayDummy(), spy, stub, publishEndPointSpy).Execute("SessionID"); Assert.True(publishEndPointSpy.MessageObject is IRequestStartingCard); IRequestStartingCard newGameData = (IRequestStartingCard)publishEndPointSpy.MessageObject; Assert.True(spy.SaveIDInput == newGameData.MessageID); }
public void ThenNewMessageIdIsAddedToAwaitingResponseGateway() { PublishEndPointSpy publishEndPointSpy = new PublishEndPointSpy(); AwaitingResponseGatewaySpy spy = new AwaitingResponseGatewaySpy(true); IGetGameInProgress getGameInProgress = new GetGameInProgress(spy, publishEndPointSpy); getGameInProgress.Execute("SessionID"); Assert.True(publishEndPointSpy.MessageObject is IGetGameData); IGetGameData newGameData = (IGetGameData)publishEndPointSpy.MessageObject; Assert.True(spy.SaveIDInput == newGameData.MessageID); }
public void ThenUIDIsAddedToRequestAndSavedToAwaitingResponseGateway() { AwaitingResponseGatewaySpy gatewaySpy = new AwaitingResponseGatewaySpy(false); PublishEndPointSpy publishSpy = new PublishEndPointSpy(); ICheckIfGameInProgress checkIfGameInProgress = new CheckIfGameInProgress(gatewaySpy, publishSpy); string id = Guid.NewGuid().ToString(); checkIfGameInProgress.Execute(id); IRequestGameIsSessionIDInUse requestGameIsSessionIDInUse = publishSpy.MessageObject as IRequestGameIsSessionIDInUse; Assert.NotNull(requestGameIsSessionIDInUse); Assert.False(requestGameIsSessionIDInUse.MessageID == null || string.IsNullOrEmpty(requestGameIsSessionIDInUse.MessageID) || string.IsNullOrWhiteSpace(requestGameIsSessionIDInUse.MessageID)); Assert.True(requestGameIsSessionIDInUse.MessageID == gatewaySpy.SaveIDInput); }
public void Setup() { _awaitingResponseGatewaySpy = new AwaitingResponseGatewaySpy(false); }