Ejemplo n.º 1
0
        public void CanBeCreatedWithControllerWithoutProperties([NoAutoProperties] TestableJSendApiController controller)
        {
            // Exercise system and verify outcome
            Action ctor = () => new JSendOkResult(controller);

            ctor.ShouldNotThrow();
        }
Ejemplo n.º 2
0
        public void CanBeCreatedWithControllerWithoutProperties(HttpStatusCode status, IJSendResponse response,
                                                                [NoAutoProperties] TestableJSendApiController controller)
        {
            // Exercise system and verify outcome
            Action ctor = () => new JSendResult <IJSendResponse>(status, response, controller);

            ctor.ShouldNotThrow();
        }
        public void CanBeCreatedWithControllerWithoutProperties([InvalidModelState] ModelStateDictionary modelState,
                                                                [NoAutoProperties] TestableJSendApiController controller)
        {
            // Exercise system and verify outcome
            Action ctor = () => new JSendInvalidModelStateResult(modelState, controller);

            ctor.ShouldNotThrow();
        }
        public void CanBeCreatedWithControllerWithoutProperties(
            Uri location, Model content, [NoAutoProperties] TestableJSendApiController controller)
        {
            // Exercise system and verify outcome
            Action ctor = () => new JSendCreatedResult <Model>(location, content, controller);

            ctor.ShouldNotThrow();
        }
Ejemplo n.º 5
0
        public void CanBeCreatedWithControllerWithoutProperties(string message, int?code, object data,
                                                                [NoAutoProperties] TestableJSendApiController controller)
        {
            // Exercise system and verify outcome
            Action ctor = () => new JSendInternalServerErrorResult(message, code, data, controller);

            ctor.ShouldNotThrow();
        }
        public void CanBeCreatedWithControllerWithoutProperties(IEnumerable <AuthenticationHeaderValue> challenges,
                                                                [NoAutoProperties] TestableJSendApiController controller)
        {
            // Exercise system and verify outcome
            Action ctor = () => new JSendUnauthorizedResult(challenges, controller);

            ctor.ShouldNotThrow();
        }
        public void CanBeCreatedWithControllerWithoutProperties(
            string routeName, Dictionary <string, object> routeValues,
            [NoAutoProperties] TestableJSendApiController controller)
        {
            // Exercise system and verify outcome
            Action ctor = () => new JSendRedirectToRouteResult(routeName, routeValues, controller);

            ctor.ShouldNotThrow();
        }
Ejemplo n.º 8
0
        public void ExecuteThrowsWhenControllerHasNoRequest(HttpStatusCode status, IJSendResponse response,
                                                            [NoAutoProperties] TestableJSendApiController controller)
        {
            // Fixture setup
            var result = new JSendResult <IJSendResponse>(status, response, controller);

            // Exercise system and verify outcome
            result.Awaiting(r => r.ExecuteAsync(CancellationToken.None))
            .ShouldThrow <InvalidOperationException>()
            .WithMessage("ApiController.Request must not be null.");
        }