public async Task DoesNotErrorRendering() { var logger = new FakeLogger(); var settingsLoader = new CodeGeneratorSettingsLoader(logger); var paths = "./Files/GithubTemplateError/History.gql"; var settings = settingsLoader.GenerateSettings(new CodeGeneratorSettingsLoaderDefaults(), new[] { paths }); var generator = new CodeGenerator(logger, settings.Single()); await generator.LoadSource(); generator.Parse(); generator.Render(); var code = generator.GeneratedCode; Assert.Empty(logger.ErrorMessages); }
public async Task GenerateNamedMutationIsCorrect() { var logger = new FakeLogger(); var settingsLoader = new CodeGeneratorSettingsLoader(logger); var paths = "./Files/Issue_19/named.gql"; var settings = settingsLoader.GenerateSettings(new CodeGeneratorSettingsLoaderDefaults(), new[] { paths }); var generator = new CodeGenerator(logger, settings.Single()); await generator.LoadSource(); generator.Parse(); generator.Render(); var code = generator.GeneratedCode; Assert.Contains("mutation IfNamedUseNameInstead($repositoyId: ID!)", code); }
public async Task CorrectExceptionTestData() { var logger = new FakeLogger(); var settingsLoader = new CodeGeneratorSettingsLoader(logger); var paths = "./Files/GithubTemplateError/History.gql"; var settings = settingsLoader.GenerateSettings(new CodeGeneratorSettingsLoaderDefaults(), new[] { paths }); var generator = new CodeGenerator(logger, settings.Single()); await generator.LoadSource(); generator.Parse(); generator.Render(); Assert.Empty(logger.ErrorMessages); Assert.Contains("public IEnumerable<string> ErrorMessages { get; private set; }", generator.GeneratedCode); }
public SchemaFiles() { logger = new FakeLogger(); settingsLoader = new CodeGeneratorSettingsLoader(logger); }
public TypescriptCodeGen() { logger = new FakeLogger(); settingsLoader = new CodeGeneratorSettingsLoader(logger); }
public Issue_8() { logger = new FakeLogger(); settingsLoader = new CodeGeneratorSettingsLoader(logger); }
public Includes() { logger = new FakeLogger(); settingsLoader = new CodeGeneratorSettingsLoader(logger); }
public CodeGeneratorTester() { this.logger = new FakeLogger(); this.settingsLoader = new CodeGeneratorSettingsLoader(logger); }
public StringifiedEnums() { logger = new FakeLogger(); settingsLoader = new CodeGeneratorSettingsLoader(logger); }
public GithubTemplateError() { logger = new FakeLogger(); settingsLoader = new CodeGeneratorSettingsLoader(logger); }
public ParseFieldsFromFragments() { logger = new FakeLogger(); settingsLoader = new CodeGeneratorSettingsLoader(logger); }
public ClientOnlyDirectives() { logger = new FakeLogger(); settingsLoader = new CodeGeneratorSettingsLoader(logger); }
public ToggleJsonConverter() { logger = new FakeLogger(); settingsLoader = new CodeGeneratorSettingsLoader(logger); }
public TemplateSettingsInJson() { logger = new FakeLogger(); settingsLoader = new CodeGeneratorSettingsLoader(logger); }