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