コード例 #1
0
        public void IssueErrorAndMessageShouldSuccessfullyAllowSuperuserToDeleteAppsFail()
        {
            // Arrange

            // Act
            var result       = sutFailure.DeleteApp(2, baseRequest);
            var errorMessage = ((BadRequestObjectResult)result.Result).Value;
            var statusCode   = ((BadRequestObjectResult)result.Result).StatusCode;

            // Assert
            Assert.That(result.Result, Is.InstanceOf <ActionResult>());
            Assert.That(errorMessage, Is.EqualTo("Status Code 400: You are not the Owner of this App"));
            Assert.That(statusCode, Is.EqualTo(400));
        }
コード例 #2
0
        public void SuccessfullyAllowSuperuserToDeleteApps()
        {
            // Arrange

            // Act
            var result     = sutSuccess.DeleteApp(2, baseRequest);
            var message    = ((BaseResult)((OkObjectResult)result.Result).Value).Message;
            var statusCode = ((OkObjectResult)result.Result).StatusCode;

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