public void AddGraphQL_ServicesSchemaSdlConfigure_ServiceNull() { // arrange // act Action action = () => ServiceCollectionExtensions.AddGraphQL( null, "type Query { a: String }", new Action <ISchemaConfiguration>(c => { })); // assert Assert.Throws <ArgumentNullException>(action); }
public void AddGraphQL_ServicesSchemaSdlConfigure_SchemaSdlEmpty() { // arrange // act Action action = () => ServiceCollectionExtensions.AddGraphQL( new ServiceCollection(), string.Empty, new Action <ISchemaConfiguration>(c => { })); // assert Assert.Throws <ArgumentNullException>(action); }
public void AddGraphQL_ServicesSchema_ServiceNull() { // arrange var schema = Schema.Create(c => c.Options.StrictValidation = false); // act Action action = () => ServiceCollectionExtensions.AddGraphQL( null, schema); // assert Assert.Throws <ArgumentNullException>(action); }
public void AddGraphQL_ServicesConfigureBuilder_ConfigureNull() { // arrange // act Action action = () => ServiceCollectionExtensions.AddGraphQL( new ServiceCollection(), default(Action <ISchemaConfiguration>), new Func <IQueryExecutionBuilder, IQueryExecutionBuilder>( b => b)); // assert Assert.Throws <ArgumentNullException>(action); }
public void AddGraphQL_ServicesSchemaConfigureBuilder_ConfigureNull() { // arrange // act Action action = () => ServiceCollectionExtensions.AddGraphQL( new ServiceCollection(), "type Query { a: String }", default(Action <ISchemaConfiguration>), new Action <IQueryExecutionBuilder>(c => { })); // assert Assert.Throws <ArgumentNullException>(action); }
public void AddGraphQL_ServicesSchemaFactoryBuilder_SchemaFactoryNull() { // arrange // act Action action = () => ServiceCollectionExtensions.AddGraphQL( new ServiceCollection(), default(Func <IServiceProvider, ISchema>), new Func <IQueryExecutionBuilder, IQueryExecutionBuilder>( b => b)); // assert Assert.Throws <ArgumentNullException>(action); }
public void AddGraphQL_ServicesSchemaConfigure_ServiceNull() { // arrange var schema = Schema.Create(c => c.Options.StrictValidation = false); // act Action action = () => ServiceCollectionExtensions.AddGraphQL( null, schema, new Action <IQueryExecutionBuilder>(c => { })); // assert Assert.Throws <ArgumentNullException>(action); }
public void AddGraphQL_ServicesSchemaFactoryBuilder_BuilderNull() { // arrange var schema = Schema.Create(c => c.Options.StrictValidation = false); // act Action action = () => ServiceCollectionExtensions.AddGraphQL( new ServiceCollection(), new Func <IServiceProvider, ISchema>(s => schema), default(Action <IQueryExecutionBuilder>)); // assert Assert.Throws <ArgumentNullException>(action); }
public void AddGraphQL_ServicesSchemaSdlConfigure_ConfigureNull() { // arrange var schema = Schema.Create(c => c.Options.StrictValidation = false); // act Action action = () => ServiceCollectionExtensions.AddGraphQL( new ServiceCollection(), "type Query { a: String }", default(Action <ISchemaConfiguration>)); // assert Assert.Throws <ArgumentNullException>(action); }
public void AddGraphQL_ServicesSchemaConfigOptions_OptionsNull() { // arrange var schema = Schema.Create(c => c.Options.StrictValidation = false); // act Action action = () => ServiceCollectionExtensions.AddGraphQL( new ServiceCollection(), new Action <ISchemaConfiguration>(c => { }), default(IQueryExecutionOptionsAccessor)); // assert Assert.Throws <ArgumentNullException>(action); }
public void AddGraphQL_ServicesSchemaConfigureBuilder_BuilderNull() { // arrange var schema = Schema.Create(c => c.Options.StrictValidation = false); // act Action action = () => ServiceCollectionExtensions.AddGraphQL( new ServiceCollection(), "type Query { a: String }", new Action <ISchemaConfiguration>(c => { }), default(Func <IQueryExecutionBuilder, IQueryExecutionBuilder>)); // assert Assert.Throws <ArgumentNullException>(action); }
public void AddGraphQL_ServicesSchema() { // arrange var services = new ServiceCollection(); var schema = Schema.Create(c => c.Options.StrictValidation = false); // act ServiceCollectionExtensions.AddGraphQL( services, schema); // assert services.Select(t => ReflectionUtils.GetTypeName(t.ServiceType)) .OrderBy(t => t, StringComparer.Ordinal) .ToArray() .MatchSnapshot(); }
public void AddGraphQL_ServicesSchemaConfigOptions() { // arrange var services = new ServiceCollection(); var options = new QueryExecutionOptions(); // act ServiceCollectionExtensions.AddGraphQL( services, c => c.Options.StrictValidation = false, options); // assert services.Select(t => ReflectionUtils.GetTypeName(t.ServiceType)) .OrderBy(t => t, StringComparer.Ordinal) .ToArray() .MatchSnapshot(); }
public void AddGraphQL_ServicesSchemaBuilder() { // arrange var services = new ServiceCollection(); // act ServiceCollectionExtensions.AddGraphQL( services, SchemaBuilder.New() .AddDocumentFromString("type Query { a: String }") .Use(next => context => default(ValueTask))); // assert services.Select(t => ReflectionUtils.GetTypeName(t.ServiceType)) .OrderBy(t => t, StringComparer.Ordinal) .ToArray() .MatchSnapshot(); }
public void AddGraphQL_ServicesSchemaSdlConfigure() { // arrange var services = new ServiceCollection(); string schema = "type Query { a: String }"; var schemaCfg = new Action <ISchemaConfiguration>( c => c.Options.StrictValidation = false); // act ServiceCollectionExtensions.AddGraphQL( services, schema, schemaCfg); // assert services.Select(t => ReflectionUtils.GetTypeName(t.ServiceType)) .OrderBy(t => t, StringComparer.Ordinal) .ToArray() .MatchSnapshot(); }
public void AddGraphQL_ServicesSchemaFactoryBuilder() { // arrange var services = new ServiceCollection(); var schema = Schema.Create(c => c.Options.StrictValidation = false); var cfg = new Action <IQueryExecutionBuilder>( c => c.UseDefaultPipeline()); // act ServiceCollectionExtensions.AddGraphQL( services, sp => schema, cfg); // assert services.Select(t => ReflectionUtils.GetTypeName(t.ServiceType)) .OrderBy(t => t, StringComparer.Ordinal) .ToArray() .MatchSnapshot(); }
public void AddGraphQL_ServicesSchemaConfigureBuilder() { // arrange var services = new ServiceCollection(); var schema = "type Query { a: String }"; var schemaCfg = new Action <ISchemaConfiguration>( c => c.Options.StrictValidation = false); var cfg = new Func <IQueryExecutionBuilder, IQueryExecutionBuilder>( c => c.UseDefaultPipeline()); // act ServiceCollectionExtensions.AddGraphQL( services, schema, schemaCfg, cfg); // assert services.Select(t => ReflectionUtils.GetTypeName(t.ServiceType)) .OrderBy(t => t, StringComparer.Ordinal) .ToArray() .MatchSnapshot(); }