Exemple #1
0
                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 _));
                }
Exemple #2
0
                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);
                }
Exemple #3
0
                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);
                }