public void GetMethodInfoTest() { var funcBody = @"public Document Initialize() { int partNr = 3; List<Available> availabilities = new List<Available>(new Available[]{ Available.Always, Available.Rarely, Available.Sometimes}); var doc = new Document(); for (int i = 0; i < partNr; i++) { var part = new Part(); part.Signer = new Signer(availabilities[i]); doc.Parts.Add(part); } return doc; }"; Func <Document> initializer = null; initializer = compiler.GenerateFunc <Document>(funcBody); var doc = initializer(); }