2 // Microsoft.CSharp.* Test Cases
5 // Erik LeBel (eriklebel@yahoo.ca)
13 using System.CodeDom.Compiler;
14 using Microsoft.CSharp;
16 using NUnit.Framework;
18 namespace MonoTests.Microsoft.CSharp
22 /// Base test for a variety of CodeGenerator GenerateCodeXXX methods.
24 /// This testing is a form of hybrid test, it tests the variety of CodeDom
25 /// classes as well as the C# code generator.
27 /// The implementations bellow provide a template as well as guidlines for
28 /// implementing further tests.
31 public abstract class CodeGeneratorTestBase
33 private CodeDomProvider provider = null;
34 protected ICodeGenerator generator = null;
35 protected CodeGeneratorOptions options = null;
37 public void InitBase()
39 provider = new CSharpCodeProvider ();
40 generator = provider.CreateGenerator ();
41 options = new CodeGeneratorOptions ();
44 protected string Generate ()
46 return Generate (options);
49 protected virtual string NewLine
54 protected abstract string Generate (CodeGeneratorOptions options);