示例#1
0
        public async Task MovePlayerToTradePileBuildsModelAndCallsPutMakerThenReturnsString()
        {
            //Arrange
            var accessToken   = "Abc";
            var playerId      = "123";
            var tradeId       = "321";
            var url           = "itemUrl";
            var expectedModel = new MovePlayerBodyModel
            {
                ItemData = new List <MovePlayerDataModel>
                {
                    new MovePlayerDataModel
                    {
                        Pile     = "trade",
                        PlayerId = "123",
                        tradeId  = "321"
                    }
                }
            };

            A.CallTo(() => _urlBuilder.GetItemUrl()).Returns(url);
            A.CallTo(() => _putRequestMaker.MovePlayerToTradePile(url, accessToken, A <MovePlayerBodyModel> .Ignored))
            .Returns(HttpStatusCode.OK);

            //Act
            var actual = await _putRequestHandler.MovePlayerToTradePile(tradeId, playerId, accessToken);

            //Assert
            actual.Should().BeEquivalentTo(HttpStatusCode.OK);
        }
示例#2
0
        public async Task <HttpStatusCode> MovePlayerToTradePile(string tradeId, string playerId, string accessToken)
        {
            var url       = _urlBuilder.GetItemUrl();
            var moveModel = new MovePlayerBodyModel
            {
                ItemData = new List <MovePlayerDataModel>
                {
                    new MovePlayerDataModel
                    {
                        Pile     = "trade",
                        PlayerId = playerId,
                        tradeId  = tradeId
                    }
                }
            };

            var response = await _putRequestMaker.MovePlayerToTradePile(url, accessToken, moveModel);

            return(response);
        }