Ejemplo n.º 1
0
        public void AddGame()
        {
            //Arrange
            var gameController = new GamesController(new Mock <IGameService>().Object);
            var winner         = "Lorem Ipsum";
            var loser          = "Dolor Sit Amet";
            var result         = new ResultDto()
            {
                Winner = winner, Loser = loser
            };

            //Act
            var response              = gameController.AddGameDetails(result);
            var responseContent       = response.Content;
            var responseContentResult = responseContent.ReadAsStringAsync().Result;

            //Assert
            response.StatusCode.Should().Be(HttpStatusCode.Created);
            responseContentResult.Should().Be("Game registered, winner Lorem Ipsum, loser Dolor Sit Amet");
        }