public void AddDocumentFromFile_Builder_Is_Null() { // arrange // act Action action = () => SchemaBuilderExtensions.AddDocumentFromFile(null, "abc"); // assert Assert.Throws <ArgumentNullException>(action); }
public void AddDocumentFromFile_File_Is_Null() { // arrange var builder = SchemaBuilder.New(); // act Action action = () => SchemaBuilderExtensions.AddDocumentFromFile(builder, null); // assert Assert.Throws <ArgumentException>(action); }
public async Task AddDocumentFromFile() { // arrange var builder = SchemaBuilder.New(); string file = IOPath.GetTempFileName(); await File.WriteAllTextAsync(file, "type Query { a: String }"); // act SchemaBuilderExtensions.AddDocumentFromFile(builder, file); // assert ISchema schema = builder .Use(next => context => next.Invoke(context)) .Create(); schema.ToString().MatchSnapshot(); }