public static void Compile(CompileArgs args) { Console.WriteLine("Compiling..."); string source = File.ReadAllText(args.Source); string compiled; switch (args.SourceType) { case SchemaSourceType.TL: compiled = TLSchemaCompiler.CompileFromTL(source, args.Namespace); break; case SchemaSourceType.JSON: compiled = TLSchemaCompiler.CompileFromJson(source, args.Namespace); break; default: throw new ArgumentOutOfRangeException(); } File.WriteAllText(args.Destination, compiled); Console.WriteLine("Compilation done successfully."); }
public void Should_compile_TL_schema() { string sharpTLSchemaCode = TLSchemaCompiler.CompileFromJson(GetTestTLJsonSchema(), "SharpTL.TestNamespace"); sharpTLSchemaCode.Should().NotBeNullOrEmpty(); }