Exemple #1
0
        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);
        }
Exemple #2
0
        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);
        }
Exemple #3
0
        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);
 }
Exemple #5
0
 public TypescriptCodeGen()
 {
     logger         = new FakeLogger();
     settingsLoader = new CodeGeneratorSettingsLoader(logger);
 }
Exemple #6
0
 public Issue_8()
 {
     logger         = new FakeLogger();
     settingsLoader = new CodeGeneratorSettingsLoader(logger);
 }
Exemple #7
0
 public Includes()
 {
     logger         = new FakeLogger();
     settingsLoader = new CodeGeneratorSettingsLoader(logger);
 }
Exemple #8
0
 public CodeGeneratorTester()
 {
     this.logger         = new FakeLogger();
     this.settingsLoader = new CodeGeneratorSettingsLoader(logger);
 }
 public StringifiedEnums()
 {
     logger         = new FakeLogger();
     settingsLoader = new CodeGeneratorSettingsLoader(logger);
 }
Exemple #10
0
 public GithubTemplateError()
 {
     logger         = new FakeLogger();
     settingsLoader = new CodeGeneratorSettingsLoader(logger);
 }
Exemple #11
0
 public ParseFieldsFromFragments()
 {
     logger         = new FakeLogger();
     settingsLoader = new CodeGeneratorSettingsLoader(logger);
 }
Exemple #12
0
 public ClientOnlyDirectives()
 {
     logger         = new FakeLogger();
     settingsLoader = new CodeGeneratorSettingsLoader(logger);
 }
Exemple #13
0
 public ToggleJsonConverter()
 {
     logger         = new FakeLogger();
     settingsLoader = new CodeGeneratorSettingsLoader(logger);
 }
Exemple #14
0
 public TemplateSettingsInJson()
 {
     logger         = new FakeLogger();
     settingsLoader = new CodeGeneratorSettingsLoader(logger);
 }