public void ThenNewMessageIDIsGUID() { GenerateSeedStub stub = new GenerateSeedStub(0); PublishEndPointSpy publishEndPointSpy = new PublishEndPointSpy(); new GetStartingCard(new PackVersionGatewayDummy(), new AwaitingResponseGatewayDummy(), stub, publishEndPointSpy).Execute("SessionID"); Assert.True(publishEndPointSpy.MessageObject is IRequestStartingCard); IRequestStartingCard newGameData = (IRequestStartingCard)publishEndPointSpy.MessageObject; Assert.True(Guid.TryParse(newGameData.MessageID, out Guid _)); }
public void ThenValueIsSavedToCreateGameGateway(int seedGeneratorReturnValue) { GenerateSeedStub stub = new GenerateSeedStub(seedGeneratorReturnValue); PublishEndPointSpy publishEndPointSpy = new PublishEndPointSpy(); new GetStartingCard(new PackVersionGatewayDummy(), new AwaitingResponseGatewayDummy(), stub, publishEndPointSpy).Execute("SessionID"); Assert.True(publishEndPointSpy.MessageObject is IRequestStartingCard); IRequestStartingCard newGameData = (IRequestStartingCard)publishEndPointSpy.MessageObject; Assert.True(Math.Abs(newGameData.Seed - seedGeneratorReturnValue) < 0.1f); }
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); }