Esempio n. 1
0
        public void IssueErrorAndMessageShouldCheckGamesFail()
        {
            // Arrange

            // Act
            var result     = sutFailure.CheckGame(1, updateGameRequest);
            var message    = ((GameResult)((NotFoundObjectResult)result.Result.Result).Value).Message;
            var statusCode = ((NotFoundObjectResult)result.Result.Result).StatusCode;

            // Assert
            Assert.That(result.Result, Is.InstanceOf <ActionResult <Game> >());
            Assert.That(message, Is.EqualTo("Status Code 404: Game not Updated"));
            Assert.That(statusCode, Is.EqualTo(404));
        }
Esempio n. 2
0
        public void SuccessfullyCheckGames()
        {
            // Arrange

            // Act
            var result     = sutSuccess.CheckGame(1, updateGameRequest);
            var message    = ((GameResult)((OkObjectResult)result.Result.Result).Value).Message;
            var statusCode = ((OkObjectResult)result.Result.Result).StatusCode;
            var game       = ((GameResult)((OkObjectResult)result.Result.Result).Value).Game;

            // Assert
            Assert.That(result.Result, Is.InstanceOf <ActionResult <Game> >());
            Assert.That(message, Is.EqualTo("Status Code 200: Game Solved"));
            Assert.That(statusCode, Is.EqualTo(200));
            Assert.That(game, Is.InstanceOf <Game>());
        }