2 // Microsoft.VisualBasic.* Test Cases
5 // Jochen Wezel (jwezel@compumaster.de)
7 // Based on the C# units of
8 // Erik LeBel (eriklebel@yahoo.ca)
10 // (c) 2003 Jochen Wezel, CompuMaster GmbH
16 using System.CodeDom.Compiler;
17 using Microsoft.VisualBasic;
19 using NUnit.Framework;
21 namespace MonoTests.Microsoft.VisualBasic
25 /// Base test for a variety of CodeGenerator GenerateCodeXXX methods.
27 /// This testing is a form of hybrid test, it tests the variety of CodeDom
28 /// classes as well as the VB code generator.
30 /// The implementations bellow provide a template as well as guidlines for
31 /// implementing further tests.
34 public abstract class CodeGeneratorTestBase
36 CodeDomProvider provider = null;
37 protected ICodeGenerator generator = null;
38 protected CodeGeneratorOptions options = null;
39 protected StringWriter writer = null;
41 public void InitBase()
43 provider = new VBCodeProvider ();
44 generator = provider.CreateGenerator ();
45 options = new CodeGeneratorOptions ();
46 writer = new StringWriter ();
48 writer.NewLine = "\n";
51 protected virtual string Code {
52 get { return writer.ToString (); }
55 protected abstract void Generate ();