Beispiel #1
0
        public void IssueErrorAndMessageShouldPostLicenseFail()
        {
            // Arrange

            // Act
            var result     = sutFailure.PostApp(TestObjects.GetLicenseRequest());
            var message    = ((AppResult)((NotFoundObjectResult)result.Result.Result).Value).Message;
            var statusCode = ((NotFoundObjectResult)result.Result.Result).StatusCode;

            // Assert
            Assert.That(result.Result, Is.InstanceOf <ActionResult <App> >());
            Assert.That(message, Is.EqualTo("Status Code 404: App not Created"));
            Assert.That(statusCode, Is.EqualTo(404));
        }
Beispiel #2
0
        public void SuccessfullyPostLicenses()
        {
            // Arrange

            // Act
            var result     = sutSuccess.PostApp(TestObjects.GetLicenseRequest());
            var app        = ((AppResult)((ObjectResult)result.Result.Result).Value).App;
            var message    = ((AppResult)((ObjectResult)result.Result.Result).Value).Message;
            var statusCode = ((ObjectResult)result.Result.Result).StatusCode;

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