public void SetMaxRequestSize() { // arrange var options = new HttpPostMiddlewareOptions(); // act options.MaxRequestSize = 4096 * 1000; // assert Assert.Equal(4096 * 1000, options.MaxRequestSize); }
public void SetMaxRequestSizeToZero() { // arrange var options = new HttpPostMiddlewareOptions(); // act Action action = () => options.MaxRequestSize = 0; // assert Assert.Throws <ArgumentException>(action); }
public void SetPath() { // arrange var options = new HttpPostMiddlewareOptions(); // act options.Path = new PathString("/foo"); // assert Assert.Equal(new PathString("/foo"), options.Path); }
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); }