示例#1
0
        public void IssueErrorAndMessageShouldDeleteGameByUserIdFail()
        {
            // Arrange
            var userId = 1;

            // Act
            var result     = sutFailure.DeleteMyGame(userId, getMyGameRequest);
            var message    = ((BaseResult)((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 Deleted"));
            Assert.That(statusCode, Is.EqualTo(404));
        }
示例#2
0
        public void SuccessfullyDeleteGameByUserId()
        {
            // Arrange
            var userId = 1;

            // Act
            var result     = sutSuccess.DeleteMyGame(userId, getMyGameRequest);
            var message    = ((BaseResult)((OkObjectResult)result.Result.Result).Value).Message;
            var statusCode = ((OkObjectResult)result.Result.Result).StatusCode;

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