Ejemplo n.º 1
0
        public void PlayGameResponse_Correct_ObjectCreated()
        {
            // Arrange
            var playGameResponse = new PlayGameResponse
            {
                IsSuccessful = this.isSuccessful,
                Error        = this.error404
            };

            // Act
            // Assert
            Assert.Equal(this.isSuccessful, playGameResponse.IsSuccessful);
            Assert.Equal(this.error404, playGameResponse.Error);
        }
Ejemplo n.º 2
0
        private async Task <PlayGameResponse> PlayGame(int idGame, int idPlayer)
        {
            try
            {
                PlayGameResponse currentResponse = await PostData <PlayGameResponse>(PlayGameCommand,
                                                                                     new Dictionary <string, object>() {
                    { "id_game", idGame },
                    { "id_player", idPlayer }
                }
                                                                                     );

                return(currentResponse);
            }
            catch (System.Net.WebException)
            {
                return(null);
            }
        }