Exemplo n.º 1
0
        public void SetMaxRequestSize()
        {
            // arrange
            var options = new HttpPostMiddlewareOptions();

            // act
            options.MaxRequestSize = 4096 * 1000;

            // assert
            Assert.Equal(4096 * 1000, options.MaxRequestSize);
        }
Exemplo n.º 2
0
        public void SetMaxRequestSizeToZero()
        {
            // arrange
            var options = new HttpPostMiddlewareOptions();

            // act
            Action action = () => options.MaxRequestSize = 0;

            // assert
            Assert.Throws <ArgumentException>(action);
        }
Exemplo n.º 3
0
        public void SetPath()
        {
            // arrange
            var options = new HttpPostMiddlewareOptions();

            // act
            options.Path = new PathString("/foo");

            // assert
            Assert.Equal(new PathString("/foo"), options.Path);
        }
Exemplo n.º 4
0
        public void SetEmptyPathString()
        {
            // arrange
            var options = new HttpPostMiddlewareOptions();

            // act
            Action action = () => options.Path = default;

            // assert
            Assert.Throws <ArgumentException>(action);
        }
        public void UseGraphQLHttpPost_BuilderServicesOptions_ServicesIsNull()
        {
            // arrange
            IAppBuilder builder = Mock.Of <IAppBuilder>();
            var         options = new HttpPostMiddlewareOptions();

            // act
            Action action =
                () => HttpPostApplicationBuilderExtensions
                .UseGraphQLHttpPost(builder, null, options);

            // assert
            Assert.Throws <ArgumentNullException>(action);
        }
        public void UseGraphQLHttpPost_BuilderServicesOptions_BuilderIsNull()
        {
            // arrange
            IServiceProvider services = new EmptyServiceProvider();
            var options = new HttpPostMiddlewareOptions();

            // act
            Action action =
                () => HttpPostApplicationBuilderExtensions
                .UseGraphQLHttpPost(null, services, options);

            // assert
            Assert.Throws <ArgumentNullException>(action);
        }