Merge pull request #2346 from xmcclure/proxy-load-fail
[mono.git] / mcs / class / System / Test / Microsoft.VisualBasic / CodeGeneratorTestBase.cs
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
11 //
12 using System;
13 using System.IO;
14 using System.Text;
15 using System.CodeDom;
16 using System.CodeDom.Compiler;
17 using Microsoft.VisualBasic;
18
19 using NUnit.Framework;
20
21 namespace MonoTests.Microsoft.VisualBasic
22 {
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
35         {
36                 CodeDomProvider provider = null;
37                 protected ICodeGenerator generator = null;
38                 protected CodeGeneratorOptions options = null;
39         
40                 public void InitBase()
41                 {
42                         provider = new VBCodeProvider ();
43                         generator = provider.CreateGenerator ();
44                         options = new CodeGeneratorOptions ();
45                 }
46
47                 protected string Generate ()
48                 {
49                         return Generate (options);
50                 }
51
52                 protected virtual string NewLine
53                 {
54                         get { return "\n"; }
55                 }
56
57                 protected abstract string Generate (CodeGeneratorOptions options);
58         }
59 }