**** Merged from MCS ****
[mono-project.git] / mcs / class / System / Test / Microsoft.VisualBasic / CodeGeneratorTestBase.cs
blob3650a4daec191cffc8c5ed87706f356b471120d1
1 //
2 // Microsoft.VisualBasic.* Test Cases
3 //
4 // Authors:
5 // Jochen Wezel (jwezel@compumaster.de)
6 //
7 // Based on the C# units of
8 // Erik LeBel (eriklebel@yahoo.ca)
9 //
10 // (c) 2003 Jochen Wezel, CompuMaster GmbH
12 using System;
13 using System.IO;
14 using System.Text;
15 using System.CodeDom;
16 using System.CodeDom.Compiler;
17 using Microsoft.VisualBasic;
19 using NUnit.Framework;
21 namespace MonoTests.Microsoft.VisualBasic
23 ///
24 /// <summary>
25 /// Base test for a variety of CodeGenerator GenerateCodeXXX methods.
26 ///
27 /// This testing is a form of hybrid test, it tests the variety of CodeDom
28 /// classes as well as the VB code generator.
29 ///
30 /// The implementations bellow provide a template as well as guidlines for
31 /// implementing further tests.
32 /// </summary>
33 ///
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 ();