Exemplo n.º 1
0
    public void TestGenerateEnum()
    {
        var gen          = new CodeUnitGenerator("TestCodeGen");
        var interfaceGen = new EnumGenerator("MyEnum");

        interfaceGen.AddOption("Option1");
        interfaceGen.AddOption("Option2");
        gen.AddType(interfaceGen);
        var ccu = gen.GenerateCompileUnit();

        var output = StringCompiler.CompileToString(ccu);

        Debug.Log(output);
        Assert.IsTrue(output.Contains("enum MyEnum"));
        Assert.IsTrue(output.Contains("Option1"));
        Assert.IsTrue(output.Contains("Option2"));
    }