예제 #1
0
        public void IssueErrorAndMessageShouldGetGamesByUserIdFail()
        {
            // Arrange

            // Act
            var result     = sutFailure.GetMyGames(getMyGameRequest, true);
            var message    = ((GamesResult)((NotFoundObjectResult)result.Result.Result).Value).Message;
            var statusCode = ((NotFoundObjectResult)result.Result.Result).StatusCode;

            // Assert
            Assert.That(result.Result, Is.InstanceOf <ActionResult <IEnumerable <Game> > >());
            Assert.That(message, Is.EqualTo("Status Code 404: Games not Found"));
            Assert.That(statusCode, Is.EqualTo(404));
        }
예제 #2
0
        public void SuccessfullyGetGamesByUserId()
        {
            // Arrange

            // Act
            var result     = sutSuccess.GetMyGames(getMyGameRequest, true);
            var message    = ((GamesResult)((OkObjectResult)result.Result.Result).Value).Message;
            var statusCode = ((OkObjectResult)result.Result.Result).StatusCode;

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