merge -r 53370:58178
[mono.git] / mcs / class / System / Test / Microsoft.CSharp / CodeGeneratorFromTypeTest.cs
index 423b126d7a12756349a8ed50697068a7694bd57e..0f34a681467468ffd058bdc8744030d885fbd123 100644 (file)
 // Microsoft.CSharp.* Test Cases
 //
 // Authors:
-//     Erik LeBel (eriklebel@yahoo.ca)
+// Eric Lebel (ericlebel@yahoo.ca)
+// Gert Driesen (drieseng@users.sourceforge.net)
 //
-// (c) 2003 Erik LeBel
+// (c) Novell
 //
+
 using System;
-using System.Globalization;
-using System.Text;
 using System.CodeDom;
 using System.CodeDom.Compiler;
+using System.Globalization;
+
+using Microsoft.CSharp;
 
 using NUnit.Framework;
 
+using MonoTests.System.CodeDom.Compiler;
+
 namespace MonoTests.Microsoft.CSharp
 {
-       ///
-       /// <summary>
-       ///     Test ICodeGenerator's GenerateCodeFromType, along with a 
-       ///     minimal set CodeDom components.
-       /// </summary>
-       ///
        [TestFixture]
-       public class CodeGeneratorFromTypeTest: CodeGeneratorTestBase
+       public class CodeGeneratorFromTypeTest_Class : CodeGeneratorFromTypeTestBase
        {
-               CodeTypeDeclaration type = null;
+               private CodeTypeDeclaration _typeDeclaration;
+               private ICodeGenerator _codeGenerator;
+
+               #region Override implementation of CodeGeneratorTestBase
+
+               protected override ICodeGenerator CodeGenerator
+               {
+                       get { return _codeGenerator; }
+               }
 
                [SetUp]
-               public void Init ()
+               public override void SetUp ()
                {
-                       InitBase ();
-                       type = new CodeTypeDeclaration ();
+                       base.SetUp ();
+                       _typeDeclaration = new CodeTypeDeclaration ();
+
+                       CodeDomProvider provider = new CSharpCodeProvider ();
+                       _codeGenerator = provider.CreateGenerator ();
                }
-               
-               protected override void Generate ()
+
+               #endregion Override implementation of CodeGeneratorTestBase
+
+               #region Override implementation of CodeGeneratorFromTypeTestBase
+
+               protected override CodeTypeDeclaration TypeDeclaration
                {
-                       generator.GenerateCodeFromType (type, writer, options);
-                       writer.Close ();
+                       get { return _typeDeclaration; }
                }
-               
+
                [Test]
-               public void DefaultTypeTest ()
+               public override void DefaultTypeTest ()
                {
-                       Generate ();
-                       Assertion.AssertEquals ("public class  {\n}\n", Code);
+                       string code = GenerateDefaultType (Options);
+                       Assert.AreEqual (string.Format (CultureInfo.InvariantCulture,
+                               "public class  {{{0}" +
+                               "}}{0}", NewLine), code);
                }
 
                [Test]
-               [ExpectedException (typeof (NullReferenceException))]
-               public void NullTypeTest ()
+               public void DefaultTypeTest_C ()
                {
-                       type = null;
-                       Generate ();
+                       CodeGeneratorOptions options = new CodeGeneratorOptions ();
+                       options.BracingStyle = "C";
+
+                       string code = GenerateDefaultType (options);
+                       Assert.AreEqual (string.Format (CultureInfo.InvariantCulture,
+                               "public class {0}" +
+                               "{{{0}" +
+                               "}}{0}", NewLine), code);
                }
 
                [Test]
-               public void SimpleTypeTest ()
+               [ExpectedException (typeof (NullReferenceException))]
+               public override void NullTypeTest ()
                {
-                       type.Name = "Test1";
-                       Generate ();
-                       Assertion.AssertEquals (string.Format (CultureInfo.InvariantCulture,
-                               "public class Test1 {{{0}}}{0}", writer.NewLine), Code);
+                       GenerateNullType (Options);
                }
 
                [Test]
-               public void AttributesAndTypeTest ()
+               public override void SimpleTypeTest ()
                {
-                       type.Name = "Test1";
-
-                       CodeAttributeDeclaration attrDec = new CodeAttributeDeclaration ();
-                       attrDec.Name = "A";
-                       type.CustomAttributes.Add (attrDec);
-
-                       attrDec = new CodeAttributeDeclaration ();
-                       attrDec.Name = "B";
-                       type.CustomAttributes.Add (attrDec);
-
-                       Generate ();
-                       Assertion.AssertEquals (string.Format (CultureInfo.InvariantCulture,
-                               "[A()]{0}"
-                               + "[B()]{0}"
-                               + "public class Test1 {{{0}"
-                               + "}}{0}", writer.NewLine), Code);
+                       string code = GenerateSimpleType (Options);
+                       Assert.AreEqual (string.Format (CultureInfo.InvariantCulture,
+                               "public class Test1 {{{0}" +
+                               "}}{0}", NewLine), code);
                }
 
                [Test]
-               public void EventMembersTypeTest1 ()
+               public void SimpleTypeTest_C ()
                {
-                       type.Name = "Test1";
-
-                       CodeMemberEvent evt = new CodeMemberEvent ();
-
-                       CodeAttributeDeclaration attrDec = new CodeAttributeDeclaration ();
-                       attrDec.Name = "A";
-                       evt.CustomAttributes.Add (attrDec);
-
-                       attrDec = new CodeAttributeDeclaration ();
-                       attrDec.Name = "B";
-                       evt.CustomAttributes.Add (attrDec);
+                       CodeGeneratorOptions options = new CodeGeneratorOptions ();
+                       options.BracingStyle = "C";
 
-                       type.Members.Add (evt);
-
-                       Generate ();
+                       string code = GenerateSimpleType (options);
                        Assert.AreEqual (string.Format (CultureInfo.InvariantCulture,
-                               "public class Test1 {{{0}"
-                               + "    {0}"
-                               + "    [A()]{0}"
-                               + "    [B()]{0}"
-                               + "    private event void ;{0}"
-                               + "}}{0}", writer.NewLine), Code);
+                               "public class Test1{0}" +
+                               "{{{0}" +
+                               "}}{0}", NewLine), code);
                }
 
                [Test]
-               public void EventMembersTypeTest2 ()
+               public override void DerivedTypeTest ()
                {
-                       type.Name = "Test1";
-
-                       CodeMemberEvent evt = new CodeMemberEvent ();
-                       evt.Name = "OnClick";
-                       evt.Attributes = MemberAttributes.Public;
-                       evt.Type = new CodeTypeReference (typeof (int));
-                       type.Members.Add (evt);
-
-                       Generate ();
+                       string code = GenerateDerivedType (Options);
                        Assert.AreEqual (string.Format (CultureInfo.InvariantCulture,
-                               "public class Test1 {{{0}"
-                               + "    {0}"
-                               + "    public event int OnClick;{0}"
-                               + "}}{0}", writer.NewLine), Code);
+#if NET_2_0
+                               "internal abstract class Test1 : int, System.Security.Principal.IIdentity, string, System.Security.IPermission {{{0}" +
+#else
+                               "abstract class Test1 : int, System.Security.Principal.IIdentity, string, System.Security.IPermission {{{0}" +
+#endif
+                               "}}{0}", NewLine), code);
                }
 
                [Test]
-               public void FieldMembersTypeTest1 ()
+               public override void AttributesAndTypeTest ()
                {
-                       type.Name = "Test1";
-
-                       CodeMemberField fld = new CodeMemberField ();
-
-                       CodeAttributeDeclaration attrDec = new CodeAttributeDeclaration ();
-                       attrDec.Name = "A";
-                       fld.CustomAttributes.Add (attrDec);
-
-                       attrDec = new CodeAttributeDeclaration ();
-                       attrDec.Name = "B";
-                       fld.CustomAttributes.Add (attrDec);
-
-                       type.Members.Add (fld);
-
-                       Generate ();
+                       string code = GenerateAttributesAndType (Options);
                        Assert.AreEqual (string.Format (CultureInfo.InvariantCulture,
-                               "public class Test1 {{{0}"
-                               + "    {0}"
-                               + "    [A()]{0}"
-                               + "    [B()]{0}"
-                               + "    private void ;{0}"
-                               + "}}{0}", writer.NewLine), Code);
+                               "[A()]{0}" +
+                               "[B()]{0}" +
+                               "public class Test1 {{{0}" +
+                               "}}{0}", NewLine), code);
                }
 
                [Test]
-               public void FieldMembersTypeTest2 ()
+               public override void EventMembersTypeTest1 ()
                {
-                       type.Name = "Test1";
-
-                       CodeMemberField fld = new CodeMemberField ();
-                       fld.Name = "Name";
-                       fld.Attributes = MemberAttributes.Public;
-                       fld.Type = new CodeTypeReference (typeof (int));
-                       type.Members.Add (fld);
+                       string code = GenerateEventMembersType1 (Options);
+                       Assert.AreEqual (string.Format (CultureInfo.InvariantCulture,
+                               "public class Test1 {{{0}" +
+                               "    {0}" +
+                               "    [A()]{0}" +
+                               "    [B()]{0}" +
+                               "    private event void ;{0}" +
+                               "}}{0}", NewLine), code);
+               }
 
-                       Generate ();
+               [Test]
+               public override void EventMembersTypeTest2 ()
+               {       
+                       string code = GenerateEventMembersType2 (Options);
                        Assert.AreEqual (string.Format (CultureInfo.InvariantCulture,
-                               "public class Test1 {{{0}"
-                               + "    {0}"
-                               + "    public int Name;{0}"
-                               + "}}{0}", writer.NewLine), Code);
+                               "public class Test1 {{{0}" +
+                               "    {0}" +
+                               "    public event int Click;{0}" +
+                               "}}{0}", NewLine), code);
                }
 
                [Test]
-               public void PropertyMembersTypeTest1 ()
+               public override void EventImplementationTypes ()
                {
-                       type.Name = "Test1";
-
-                       CodeMemberProperty property = new CodeMemberProperty ();
-
-                       CodeAttributeDeclaration attrDec = new CodeAttributeDeclaration ();
-                       attrDec.Name = "A";
-                       property.CustomAttributes.Add (attrDec);
-
-                       attrDec = new CodeAttributeDeclaration ();
-                       attrDec.Name = "B";
-                       property.CustomAttributes.Add (attrDec);
-
-                       type.Members.Add (property);
-
-                       Generate ();
+                       string code = GenerateEventImplementationTypes (Options);
                        Assert.AreEqual (string.Format (CultureInfo.InvariantCulture,
-                               "public class Test1 {{{0}"
-                               + "    {0}"
-                               + "    [A()]{0}"
-                               + "    [B()]{0}"
-                               + "    private void  {{{0}"
-                               + "    }}{0}"
-                               + "}}{0}", writer.NewLine), Code);
+                               "public class Test1 {{{0}" +
+                               "    {0}" +
+#if NET_2_0
+                               "    internal event int Click;{0}" +
+#else
+                               "    /*FamANDAssem*/ internal event int Click;{0}" +
+#endif
+                               "}}{0}", NewLine), code);
                }
 
+               /// <summary>
+               /// Ensure no access modifiers are output if PrivateImplementationType
+               /// is set.
+               /// </summary>
                [Test]
-               public void PropertyMembersTypeTest2 ()
+               public override void EventPrivateImplementationType ()
                {
-                       type.Name = "Test1";
-
-                       CodeMemberProperty property = new CodeMemberProperty ();
-                       property.Name = "Name";
-                       property.Attributes = MemberAttributes.Public;
-                       property.Type = new CodeTypeReference (typeof (int));
-                       type.Members.Add (property);
+                       string code = GenerateEventPrivateImplementationType (Options);
+                       Assert.AreEqual (string.Format (CultureInfo.InvariantCulture,
+                               "public class Test1 {{{0}" +
+                               "    {0}" +
+                               "    event int System.Int32.Click;{0}" +
+                               "}}{0}", NewLine), code);
+               }
 
-                       Generate ();
+               /// <summary>
+               /// If both ImplementationTypes and PrivateImplementationType are set,
+               /// then only ImplementationTypes are output.
+               /// </summary>
+               [Test]
+               public override void EventImplementationTypeOrder ()
+               {
+                       string code = GenerateEventImplementationTypeOrder (Options);
                        Assert.AreEqual (string.Format (CultureInfo.InvariantCulture,
-                               "public class Test1 {{{0}"
-                               + "    {0}"
-                               + "    public virtual int Name {{{0}"
-                               + "    }}{0}"
-                               + "}}{0}", writer.NewLine), Code);
+                               "public class Test1 {{{0}" +
+                               "    {0}" +
+                               "    event int System.Int32.Click;{0}" +
+                               "}}{0}", NewLine), code);
                }
 
                [Test]
-               public void PropertyMembersTypeGetOnly ()
+               public override void FieldMembersAttributesTest ()
                {
-                       type.Name = "Test1";
+                       string code = GenerateFieldMembersAttributes (Options);
+                       Assert.AreEqual (string.Format (CultureInfo.InvariantCulture,
+                               "public class Test1 {{{0}" +
+                               "    {0}" +
+                               "    [A()]{0}" +
+                               "    [B()]{0}" +
+                               "    private void ;{0}" +
+                               "}}{0}", NewLine), code);
+               }
 
-                       CodeMemberProperty property = new CodeMemberProperty ();
-                       property.Name = "Name";
-                       property.Attributes = MemberAttributes.Family;
-                       property.HasGet = true;
-                       property.Type = new CodeTypeReference (typeof (int));
-                       type.Members.Add (property);
+               [Test]
+               public override void FieldMembersTypeTest ()
+               {
+                       string code = GenerateFieldMembersType (MemberAttributes.Public, Options);
+                       Assert.AreEqual (string.Format (CultureInfo.InvariantCulture,
+                               "public class Test1 {{{0}" +
+                               "    {0}" +
+                               "    public int Name = 2;{0}" +
+                               "}}{0}", NewLine), code);
+               }
 
-                       Generate ();
+               [Test]
+               public override void FieldNewSlotTest ()
+               {
+                       string code = GenerateFieldMembersType (MemberAttributes.Assembly |
+                               MemberAttributes.New, Options);
                        Assert.AreEqual (string.Format (CultureInfo.InvariantCulture,
-                               "public class Test1 {{{0}"
-                               + "    {0}"
-                               + "    protected virtual int Name {{{0}"
-                               + "        get {{{0}"
-                               + "        }}{0}"
-                               + "    }}{0}"
-                               + "}}{0}", writer.NewLine), Code);
+                               "public class Test1 {{{0}" +
+                               "    {0}" +
+                               "    internal new int Name = 2;{0}" +
+                               "}}{0}", NewLine), code);
                }
 
                [Test]
-               public void PropertyMembersTypeSetOnly ()
+               public override void PropertyMembersTypeTest1 ()
                {
-                       type.Name = "Test1";
+                       string code = GeneratePropertyMembersAttributes (Options);
+                       Assert.AreEqual (string.Format (CultureInfo.InvariantCulture,
+                               "public class Test1 {{{0}" +
+                               "    {0}" +
+                               "    [A()]{0}" +
+                               "    [B()]{0}" +
+                               "    private void  {{{0}" +
+                               "    }}{0}" +
+                               "}}{0}", NewLine), code);
+               }
 
-                       CodeMemberProperty property = new CodeMemberProperty ();
-                       property.Name = "Name";
-                       property.Attributes = MemberAttributes.FamilyOrAssembly;
-                       property.HasSet = true;
-                       property.Type = new CodeTypeReference (typeof (int));
-                       type.Members.Add (property);
+               [Test]
+               public void PropertyMembersTypeTest1_C ()
+               {
+                       CodeGeneratorOptions options = new CodeGeneratorOptions ();
+                       options.BracingStyle = "C";
 
-                       Generate ();
+                       string code = GeneratePropertyMembersAttributes (options);
                        Assert.AreEqual (string.Format (CultureInfo.InvariantCulture,
-                               "public class Test1 {{{0}"
-                               + "    {0}"
-                               + "    protected internal int Name {{{0}"
-                               + "        set {{{0}"
-                               + "        }}{0}"
-                               + "    }}{0}"
-                               + "}}{0}", writer.NewLine), Code);
+                               "public class Test1{0}" + 
+                               "{{{0}" +
+                               "    {0}" +
+                               "    [A()]{0}" +
+                               "    [B()]{0}" +
+                               "    private void {0}" + 
+                               "    {{{0}" +
+                               "    }}{0}" +
+                               "}}{0}", NewLine), code);
                }
 
                [Test]
-               public void PropertyMembersTypeGetSet ()
+               public override void PropertyMembersTypeTest2 ()
                {
-                       type.Name = "Test1";
+                       string code = GeneratePropertyMembersType (MemberAttributes.Public,
+                               false, false, Options);
+                       Assert.AreEqual (string.Format (CultureInfo.InvariantCulture,
+                               "public class Test1 {{{0}" +
+                               "    {0}" +
+                               "    public virtual int Name {{{0}" +
+                               "    }}{0}" +
+                               "}}{0}", NewLine), code);
+               }
 
-                       CodeMemberProperty property = new CodeMemberProperty ();
-                       property.Name = "Name";
-                       property.Attributes = MemberAttributes.Assembly;
-                       property.HasGet = true;
-                       property.HasSet = true;
-                       property.Type = new CodeTypeReference (typeof (int));
-                       type.Members.Add (property);
+               [Test]
+               public override void PropertyMembersTypeGetOnly ()
+               {
+                       string code = GeneratePropertyMembersType (MemberAttributes.Family,
+                               true, false, Options);
+                       Assert.AreEqual (string.Format (CultureInfo.InvariantCulture,
+                               "public class Test1 {{{0}" +
+                               "    {0}" +
+                               "    protected virtual int Name {{{0}" +
+                               "        get {{{0}" +
+                               "        }}{0}" +
+                               "    }}{0}" +
+                               "}}{0}", NewLine), code);
+               }
 
-                       Generate ();
+               [Test]
+               public override void PropertyMembersTypeSetOnly ()
+               {
+                       string code = GeneratePropertyMembersType (MemberAttributes.Assembly,
+                               false, true, Options);
                        Assert.AreEqual (string.Format (CultureInfo.InvariantCulture,
-                               "public class Test1 {{{0}"
-                               + "    {0}"
+                               "public class Test1 {{{0}" +
+                               "    {0}" +
 #if NET_2_0
-                               + "    internal virtual int Name {{{0}"
+                               "    internal virtual int Name {{{0}" +
 #else
-                               + "    internal int Name {{{0}"
+                               "    internal int Name {{{0}" +
 #endif
-                               + "        get {{{0}"
-                               + "        }}{0}"
-                               + "        set {{{0}"
-                               + "        }}{0}"
-                               + "    }}{0}"
-                               + "}}{0}", writer.NewLine), Code);
+                               "        set {{{0}" +
+                               "        }}{0}" +
+                               "    }}{0}" +
+                               "}}{0}", NewLine), code);
+               }
+
+               [Test]
+               public override void PropertyMembersTypeGetSet ()
+               {
+                       string code = GeneratePropertyMembersType (MemberAttributes.Family,
+                               true, true, Options);
+                       Assert.AreEqual (string.Format (CultureInfo.InvariantCulture,
+                               "public class Test1 {{{0}" +
+                               "    {0}" +
+                               "    protected virtual int Name {{{0}" +
+                               "        get {{{0}" +
+                               "        }}{0}" +
+                               "        set {{{0}" +
+                               "        }}{0}" +
+                               "    }}{0}" +
+                               "}}{0}", NewLine), code);
                }
 
                [Test]
-               public void PropertyMembersTypeFamilyAndAssembly ()
+               public void PropertyMembersTypeGetSet_C ()
                {
-                       type.Name = "Test1";
+                       CodeGeneratorOptions options = new CodeGeneratorOptions ();
+                       options.BracingStyle = "C";
 
-                       CodeMemberProperty property = new CodeMemberProperty ();
-                       property.Name = "Name";
-                       property.Attributes = MemberAttributes.FamilyAndAssembly;
-                       property.Type = new CodeTypeReference (typeof (int));
+                       string code = GeneratePropertyMembersType (MemberAttributes.Family,
+                               true, true, options);
+                       Assert.AreEqual (string.Format (CultureInfo.InvariantCulture,
+                               "public class Test1{0}" + 
+                               "{{{0}" +
+                               "    {0}" +
+                               "    protected virtual int Name{0}" + 
+                               "    {{{0}" +
+                               "        get{0}" + 
+                               "        {{{0}" +
+                               "        }}{0}" +
+                               "        set{0}" + 
+                               "        {{{0}" +
+                               "        }}{0}" +
+                               "    }}{0}" +
+                               "}}{0}", NewLine), code);
+               }
 
-                       type.Members.Add (property);
+               [Test]
+               public override void PropertyMembersTypeFamilyOrAssembly ()
+               {
+                       string code = GeneratePropertyMembersType (MemberAttributes.FamilyOrAssembly,
+                               false, false, Options);
+                       Assert.AreEqual (string.Format (CultureInfo.InvariantCulture,
+                               "public class Test1 {{{0}" +
+                               "    {0}" +
+                               "    protected internal int Name {{{0}" +
+                               "    }}{0}" +
+                               "}}{0}", NewLine), code);
+               }
 
-                       Generate ();
+               [Test]
+               public override void PropertyMembersTypeAssembly ()
+               {
+                       string code = GeneratePropertyMembersType (MemberAttributes.Assembly,
+                               false, false, Options);
                        Assert.AreEqual (string.Format (CultureInfo.InvariantCulture,
-                               "public class Test1 {{{0}"
-                               + "    {0}"
+                               "public class Test1 {{{0}" +
+                               "    {0}" +
 #if NET_2_0
-                               + "    internal int Name {{{0}"
+                               "    internal virtual int Name {{{0}" +
 #else
-                               + "    /*FamANDAssem*/ internal int Name {{{0}"
+                               "    internal int Name {{{0}" +
 #endif
-                               + "    }}{0}"
-                               + "}}{0}", writer.NewLine), Code);
+                               "    }}{0}" +
+                               "}}{0}", NewLine), code);
                }
 
+               /// <summary>
+               /// Apparently VB.NET CodeDOM also allows properties that aren't indexers
+               /// to have parameters.
+               /// </summary>
                [Test]
-               public void MethodMembersTypeTest1 ()
+               public override void PropertyParametersTest ()
                {
-                       type.Name = "Test1";
-
-                       CodeMemberMethod method = new CodeMemberMethod ();
-
-                       CodeAttributeDeclaration attrDec = new CodeAttributeDeclaration ();
-                       attrDec.Name = "A";
-                       method.CustomAttributes.Add (attrDec);
-
-                       attrDec = new CodeAttributeDeclaration ();
-                       attrDec.Name = "B";
-                       method.CustomAttributes.Add (attrDec);
-
-                       type.Members.Add (method);
-
-                       Generate ();
+                       string code = GeneratePropertyParameters (Options);
                        Assert.AreEqual (string.Format (CultureInfo.InvariantCulture,
-                               "public class Test1 {{{0}"
-                               + "    {0}"
-                               + "    [A()]{0}"
-                               + "    [B()]{0}"
-                               + "    private void () {{{0}"
-                               + "    }}{0}"
-                               + "}}{0}", writer.NewLine), Code);
+                               "public class Test1 {{{0}" +
+                               "    {0}" +
+                               "    public virtual int Name {{{0}" +
+                               "    }}{0}" +
+                               "}}{0}", NewLine), code);
                }
 
                [Test]
-               public void MethodMembersTypeTest2 ()
+               public override void PropertyIndexerTest1 ()
                {
-                       type.Name = "Test1";
-
-                       CodeMemberMethod method = new CodeMemberMethod ();
-                       method.Name = "Something";
-                       method.Attributes = MemberAttributes.Public;
-                       method.ReturnType = new CodeTypeReference (typeof (int));
-
-                       CodeParameterDeclarationExpression param = new CodeParameterDeclarationExpression (
-                               typeof (object), "value1");
-                       method.Parameters.Add (param);
-
-                       param = new CodeParameterDeclarationExpression (
-                               typeof (object), "value2");
-                       param.Direction = FieldDirection.In;
-                       method.Parameters.Add (param);
-
-                       param = new CodeParameterDeclarationExpression (typeof (int), "index");
-                       param.Direction = FieldDirection.Out;
-                       method.Parameters.Add (param);
-
-                       param = new CodeParameterDeclarationExpression (typeof (int), "count");
-                       param.Direction = FieldDirection.Ref;
-                       method.Parameters.Add (param);
-
-                       type.Members.Add (method);
-
-                       Generate ();
+                       string code = GeneratePropertyIndexer (MemberAttributes.Public,
+                               false, false, true, Options);
                        Assert.AreEqual (string.Format (CultureInfo.InvariantCulture,
-                               "public class Test1 {{{0}"
-                               + "    {0}"
-                               + "    public virtual int Something(object value1, object value2, out int index, ref int count) {{{0}"
-                               + "    }}{0}"
-                               + "}}{0}", writer.NewLine), Code);
+                               "public class Test1 {{{0}" +
+                               "    {0}" +
+                               "    public virtual int this[object value1, ref int value2] {{{0}" +
+                               "    }}{0}" +
+                               "}}{0}", NewLine), code);
                }
 
                [Test]
-               public void MethodMembersTypeTest3 ()
+               public override void PropertyIndexerTest2 ()
                {
-                       type.Name = "Test1";
-
-                       CodeMemberMethod method = new CodeMemberMethod ();
-                       method.Name = "Something";
-                       method.Attributes = MemberAttributes.Public;
-                       method.ReturnType = new CodeTypeReference (typeof (int));
-
-                       // first parameter
-                       CodeParameterDeclarationExpression param = new CodeParameterDeclarationExpression (
-                               typeof (object), "value");
-                       method.Parameters.Add (param);
-
-                       CodeAttributeDeclaration attrDec = new CodeAttributeDeclaration ();
-                       attrDec.Name = "A";
-                       param.CustomAttributes.Add (attrDec);
-
-                       attrDec = new CodeAttributeDeclaration ();
-                       attrDec.Name = "B";
-                       param.CustomAttributes.Add (attrDec);
-
-                       // second parameter
-                       param = new CodeParameterDeclarationExpression (typeof (int), "index");
-                       param.Direction = FieldDirection.Out;
-                       method.Parameters.Add (param);
-
-                       attrDec = new CodeAttributeDeclaration ();
-                       attrDec.Name = "C";
-                       attrDec.Arguments.Add (new CodeAttributeArgument ("A1",
-                               new CodePrimitiveExpression (false)));
-                       attrDec.Arguments.Add (new CodeAttributeArgument ("A2",
-                               new CodePrimitiveExpression (true)));
-                       param.CustomAttributes.Add (attrDec);
-
-                       attrDec = new CodeAttributeDeclaration ();
-                       attrDec.Name = "D";
-                       param.CustomAttributes.Add (attrDec);
-
-                       type.Members.Add (method);
-
-                       Generate ();
+                       string code = GeneratePropertyIndexer (MemberAttributes.Public,
+                               false, false, false, Options);
                        Assert.AreEqual (string.Format (CultureInfo.InvariantCulture,
-                               "public class Test1 {{{0}"
-                               + "    {0}"
-                               + "    public virtual int Something([A()] [B()] object value, [C(A1=false, A2=true)] [D()] out int index) {{{0}"
-                               + "    }}{0}"
-                               + "}}{0}", writer.NewLine), Code);
+                               "public class Test1 {{{0}" +
+                               "    {0}" +
+                               "    public virtual int iTem {{{0}" +
+                               "    }}{0}" +
+                               "}}{0}", NewLine), code);
                }
 
                [Test]
-               public void ConstructorAttributesTest ()
+               public override void PropertyIndexerGetOnly ()
                {
-                       type.Name = "Test1";
-
-                       CodeConstructor ctor = new CodeConstructor ();
-
-                       CodeAttributeDeclaration attrDec = new CodeAttributeDeclaration ();
-                       attrDec.Name = "A";
-                       ctor.CustomAttributes.Add (attrDec);
-
-                       attrDec = new CodeAttributeDeclaration ();
-                       attrDec.Name = "B";
-                       ctor.CustomAttributes.Add (attrDec);
-
-                       type.Members.Add (ctor);
-
-                       Generate ();
+                       string code = GeneratePropertyIndexer (MemberAttributes.Family,
+                               true, false, true, Options);
                        Assert.AreEqual (string.Format (CultureInfo.InvariantCulture,
-                               "public class Test1 {{{0}"
-                               + "    {0}"
-                               + "    [A()]{0}"
-                               + "    [B()]{0}"
-                               + "    private Test1() {{{0}"
-                               + "    }}{0}"
-                               + "}}{0}", writer.NewLine), Code);
+                               "public class Test1 {{{0}" +
+                               "    {0}" +
+                               "    protected virtual int this[object value1, ref int value2] {{{0}" +
+                               "        get {{{0}" +
+                               "        }}{0}" +
+                               "    }}{0}" +
+                               "}}{0}", NewLine), code);
                }
 
                [Test]
-               public void ConstructorParametersTest ()
+               public override void PropertyIndexerSetOnly ()
                {
-                       type.Name = "Test1";
-
-                       CodeConstructor ctor = new CodeConstructor ();
-                       ctor.Name = "Whatever";
-                       ctor.Attributes = MemberAttributes.Public;
-
-                       CodeParameterDeclarationExpression param = new CodeParameterDeclarationExpression (
-                               typeof (object), "value1");
-                       ctor.Parameters.Add (param);
-
-                       param = new CodeParameterDeclarationExpression (
-                               typeof (object), "value2");
-                       param.Direction = FieldDirection.In;
-                       ctor.Parameters.Add (param);
-
-                       param = new CodeParameterDeclarationExpression (typeof (int), "index");
-                       param.Direction = FieldDirection.Out;
-                       ctor.Parameters.Add (param);
-
-                       param = new CodeParameterDeclarationExpression (typeof (int), "count");
-                       param.Direction = FieldDirection.Ref;
-                       ctor.Parameters.Add (param);
-
-                       type.Members.Add (ctor);
-
-                       Generate ();
+                       string code = GeneratePropertyIndexer (MemberAttributes.Family,
+                               false, true, true, Options);
                        Assert.AreEqual (string.Format (CultureInfo.InvariantCulture,
-                               "public class Test1 {{{0}"
-                               + "    {0}"
-                               + "    public Test1(object value1, object value2, out int index, ref int count) {{{0}"
-                               + "    }}{0}"
-                               + "}}{0}", writer.NewLine), Code);
+                               "public class Test1 {{{0}" +
+                               "    {0}" +
+                               "    protected virtual int this[object value1, ref int value2] {{{0}" +
+                               "        set {{{0}" +
+                               "        }}{0}" +
+                               "    }}{0}" +
+                               "}}{0}", NewLine), code);
                }
 
                [Test]
-               public void ConstructorParameterAttributesTest ()
+               public override void PropertyImplementationTypes ()
                {
-                       type.Name = "Test1";
-
-                       CodeConstructor ctor = new CodeConstructor ();
-                       ctor.Name = "Something";
-                       ctor.Attributes = MemberAttributes.Public;
-
-                       // first parameter
-                       CodeParameterDeclarationExpression param = new CodeParameterDeclarationExpression (
-                               typeof (object), "value");
-                       ctor.Parameters.Add (param);
-
-                       CodeAttributeDeclaration attrDec = new CodeAttributeDeclaration ();
-                       attrDec.Name = "A";
-                       param.CustomAttributes.Add (attrDec);
-
-                       attrDec = new CodeAttributeDeclaration ();
-                       attrDec.Name = "B";
-                       param.CustomAttributes.Add (attrDec);
-
-                       // second parameter
-                       param = new CodeParameterDeclarationExpression (typeof (int), "index");
-                       param.Direction = FieldDirection.Out;
-                       ctor.Parameters.Add (param);
-
-                       attrDec = new CodeAttributeDeclaration ();
-                       attrDec.Name = "C";
-                       attrDec.Arguments.Add (new CodeAttributeArgument ("A1",
-                               new CodePrimitiveExpression (false)));
-                       attrDec.Arguments.Add (new CodeAttributeArgument ("A2",
-                               new CodePrimitiveExpression (true)));
-                       param.CustomAttributes.Add (attrDec);
+                       string code = GeneratePropertyImplementationTypes (Options);
+                       Assert.AreEqual (string.Format (CultureInfo.InvariantCulture,
+                               "public class Test1 {{{0}" +
+                               "    {0}" +
+                               "    public virtual int Name {{{0}" +
+                               "    }}{0}" +
+                               "}}{0}", NewLine), code);
+               }
 
-                       attrDec = new CodeAttributeDeclaration ();
-                       attrDec.Name = "D";
-                       param.CustomAttributes.Add (attrDec);
+               /// <summary>
+               /// Ensure that Overloads keyword is output for a property which has
+               /// explicitly been marked as Overloaded.
+               /// </summary>
+               [Test]
+               public override void PropertyOverloadsTest1 ()
+               {
+                       string code = GeneratePropertyOverloads1 (Options);
+                       Assert.AreEqual (string.Format (CultureInfo.InvariantCulture,
+                               "public class Test1 {{{0}" +
+                               "    {0}" +
+                               "    protected virtual int Name {{{0}" +
+                               "    }}{0}" +
+                               "}}{0}", NewLine), code);
+               }
 
-                       type.Members.Add (ctor);
+               /// <summary>
+               /// Ensure that Overloads keyword is output if multiple properties with
+               /// the same name are defined.
+               /// </summary>
+               [Test]
+               public override void PropertyOverloadsTest2 ()
+               {
+                       string code = GeneratePropertyOverloads2 (Options);
+                       Assert.AreEqual (string.Format (CultureInfo.InvariantCulture,
+                               "public class Test1 {{{0}" +
+                               "    {0}" +
+                               "    public virtual int Name {{{0}" +
+                               "    }}{0}" +
+                               "    {0}" +
+                               "    private int Name {{{0}" +
+                               "    }}{0}" +
+                               "}}{0}", NewLine), code);
+               }
 
-                       Generate ();
+               /// <summary>
+               /// Ensure that a property with a PrivateImplementationType and with 
+               /// the same name does not qualify as an overload.
+               /// </summary>
+               [Test]
+               public override void PropertyOverloadsTest3 ()
+               {
+                       string code = GeneratePropertyOverloads3 (Options);
                        Assert.AreEqual (string.Format (CultureInfo.InvariantCulture,
-                               "public class Test1 {{{0}"
-                               + "    {0}"
-                               + "    public Test1([A()] [B()] object value, [C(A1=false, A2=true)] [D()] out int index) {{{0}"
-                               + "    }}{0}"
-                               + "}}{0}", writer.NewLine), Code);
+                               "public class Test1 {{{0}" +
+                               "    {0}" +
+                               "    public virtual int Name {{{0}" +
+                               "    }}{0}" +
+                               "    {0}" +
+                               "    int System.Int32.Name {{{0}" +
+                               "    }}{0}" +
+                               "}}{0}", NewLine), code);
                }
 
+               /// <summary>
+               /// Ensure no access modifiers are output if PrivateImplementationType
+               /// is set. Default keyword is also not output in this case.
+               /// </summary>
                [Test]
-               public void BaseConstructorSingleArg ()
+               public override void PropertyPrivateImplementationType ()
                {
-                       type.Name = "Test1";
+                       string code = GeneratePropertyPrivateImplementationType (Options);
+                       Assert.AreEqual (string.Format (CultureInfo.InvariantCulture,
+                               "public class Test1 {{{0}" +
+                               "    {0}" +
+                               "    int System.Int32.this[object value1] {{{0}" +
+                               "    }}{0}" +
+                               "}}{0}", NewLine), code);
+               }
 
-                       CodeConstructor ctor = new CodeConstructor ();
-                       ctor.Name = "Something";
-                       ctor.Attributes = MemberAttributes.Public;
+               /// <summary>
+               /// If both ImplementationTypes and PrivateImplementationType are set,
+               /// then only ImplementationTypes are output.
+               /// </summary>
+               [Test]
+               public override void PropertyImplementationTypeOrder ()
+               {
+                       string code = GeneratePropertyImplementationTypeOrder (Options);
+                       Assert.AreEqual (string.Format (CultureInfo.InvariantCulture,
+                               "public class Test1 {{{0}" +
+                               "    {0}" +
+                               "    int System.Int32.this[object value1] {{{0}" +
+                               "    }}{0}" +
+                               "}}{0}", NewLine), code);
+               }
 
-                       // first parameter
-                       CodeParameterDeclarationExpression param = new CodeParameterDeclarationExpression (
-                               typeof (object), "value1");
-                       ctor.Parameters.Add (param);
+               [Test]
+               public override void PropertyNewSlotTest ()
+               {
+                       string code = GeneratePropertyMembersType (MemberAttributes.Private |
+                               MemberAttributes.New, true, true, Options);
+                       Assert.AreEqual (string.Format (CultureInfo.InvariantCulture,
+                               "public class Test1 {{{0}" +
+                               "    {0}" +
+                               "    private new int Name {{{0}" +
+                               "        get {{{0}" +
+                               "        }}{0}" +
+                               "        set {{{0}" +
+                               "        }}{0}" +
+                               "    }}{0}" +
+                               "}}{0}", NewLine), code);
+               }
 
-                       // second parameter
-                       param = new CodeParameterDeclarationExpression (typeof (int), "value2");
-                       param.Direction = FieldDirection.Out;
-                       ctor.Parameters.Add (param);
+               [Test]
+               public override void MethodMembersTypeTest1 ()
+               {
+                       string code = GenerateMethodMembersType1 (Options);
+                       Assert.AreEqual (string.Format (CultureInfo.InvariantCulture,
+                               "public class Test1 {{{0}" +
+                               "    {0}" +
+                               "    [A()]{0}" +
+                               "    [B()]{0}" +
+                               "    private void () {{{0}" +
+                               "    }}{0}" +
+                               "}}{0}", NewLine), code);
+               }
 
-                       // base ctor args
-                       ctor.BaseConstructorArgs.Add (new CodeVariableReferenceExpression ("value1"));
+               [Test]
+               public void MethodMembersTypeTest1_C ()
+               {
+                       CodeGeneratorOptions options = new CodeGeneratorOptions ();
+                       options.BracingStyle = "C";
 
-                       type.Members.Add (ctor);
+                       string code = GenerateMethodMembersType1 (options);
+                       Assert.AreEqual (string.Format (CultureInfo.InvariantCulture,
+                               "public class Test1{0}" + 
+                               "{{{0}" +
+                               "    {0}" +
+                               "    [A()]{0}" +
+                               "    [B()]{0}" +
+                               "    private void (){0}" + 
+                               "    {{{0}" +
+                               "    }}{0}" +
+                               "}}{0}", NewLine), code);
+               }
 
-                       Generate ();
+               [Test]
+               public override void MethodMembersTypeTest2 ()
+               {
+                       string code = GenerateMethodMembersType2 (Options);
                        Assert.AreEqual (string.Format (CultureInfo.InvariantCulture,
-                               "public class Test1 {{{0}"
-                               + "    {0}"
-                               + "    public Test1(object value1, out int value2) : {0}"
-                               + "            base(value1) {{{0}"
-                               + "    }}{0}"
-                               + "}}{0}", writer.NewLine), Code);
+                               "public class Test1 {{{0}" +
+                               "    {0}" +
+                               "    public virtual int Something(object value1, object value2, out int index, ref int count) {{{0}" +
+                               "    }}{0}" +
+                               "}}{0}", NewLine), code);
                }
 
                [Test]
-               public void BaseConstructorMultipleArgs ()
+               public override void MethodMembersTypeTest3 ()
                {
-                       type.Name = "Test1";
+                       string code = GenerateMethodMembersType3 (Options);
+                       Assert.AreEqual (string.Format (CultureInfo.InvariantCulture,
+                               "public class Test1 {{{0}" +
+                               "    {0}" +
+                               "    public virtual int Something([A()] [B()] object value, [C(A1=false, A2=true)] [D()] out int index) {{{0}" +
+                               "    }}{0}" +
+                               "}}{0}", NewLine), code);
+               }
 
-                       CodeConstructor ctor = new CodeConstructor ();
-                       ctor.Name = "Something";
-                       ctor.Attributes = MemberAttributes.Public;
+               [Test]
+               public override void MethodImplementationTypes ()
+               {
+                       string code = GenerateMethodImplementationTypes (Options);
+                       Assert.AreEqual (string.Format (CultureInfo.InvariantCulture,
+                               "public class Test1 {{{0}" +
+                               "    {0}" +
+#if NET_2_0
+                               "    internal virtual int Execute() {{{0}" +
+#else
+                               "    internal int Execute() {{{0}" +
+#endif
+                               "    }}{0}" +
+                               "}}{0}", NewLine), code);
+               }
 
-                       // first parameter
-                       CodeParameterDeclarationExpression param = new CodeParameterDeclarationExpression (
-                               typeof (object), "value1");
-                       ctor.Parameters.Add (param);
+               [Test]
+               public override void MethodOverloadsTest1 ()
+               {
+                       string code = GenerateMethodOverloads1 (Options);
+                       Assert.AreEqual (string.Format (CultureInfo.InvariantCulture,
+                               "public class Test1 {{{0}" +
+                               "    {0}" +
+#if NET_2_0
+                               "    internal virtual int Execute() {{{0}" +
+#else
+                               "    internal int Execute() {{{0}" +
+#endif
+                               "    }}{0}" +
+                               "}}{0}", NewLine), code);
+               }
 
-                       // second parameter
-                       param = new CodeParameterDeclarationExpression (typeof (int), "value2");
-                       param.Direction = FieldDirection.Out;
-                       ctor.Parameters.Add (param);
+               [Test]
+               public override void MethodOverloadsTest2 ()
+               {
+                       string code = GenerateMethodOverloads2 (Options);
+                       Assert.AreEqual (string.Format (CultureInfo.InvariantCulture,
+                               "public class Test1 {{{0}" +
+                               "    {0}" +
+                               "    public virtual void Execute() {{{0}" +
+                               "    }}{0}" +
+                               "    {0}" +
+                               "    private int Execute(object value1) {{{0}" +
+                               "    }}{0}" +
+                               "}}{0}", NewLine), code);
+               }
 
-                       // base ctor args
-                       ctor.BaseConstructorArgs.Add (new CodeVariableReferenceExpression ("value1"));
-                       ctor.BaseConstructorArgs.Add (new CodeVariableReferenceExpression ("value2"));
+               /// <summary>
+               /// Ensure that a method with a PrivateImplementationType and with 
+               /// the same name does not qualify as an overload.
+               /// </summary>
+               [Test]
+               public override void MethodOverloadsTest3 ()
+               {
+                       string code = GenerateMethodOverloads3 (Options);
+                       Assert.AreEqual (string.Format (CultureInfo.InvariantCulture,
+                               "public class Test1 {{{0}" +
+                               "    {0}" +
+                               "    public virtual void Execute() {{{0}" +
+                               "    }}{0}" +
+                               "    {0}" +
+                               "    int System.Int32.Execute(object value1) {{{0}" +
+                               "    }}{0}" +
+                               "}}{0}", NewLine), code);
+               }
 
-                       type.Members.Add (ctor);
+               /// <summary>
+               /// Ensure no access modifiers are output if PrivateImplementationType
+               /// is set.
+               /// </summary>
+               [Test]
+               public override void MethodPrivateImplementationType ()
+               {
+                       string code = GenerateMethodPrivateImplementationType (Options);
+                       Assert.AreEqual (string.Format (CultureInfo.InvariantCulture,
+                               "public class Test1 {{{0}" +
+                               "    {0}" +
+                               "    int System.Int32.Execute(object value1) {{{0}" +
+                               "    }}{0}" +
+                               "}}{0}", NewLine), code);
+               }
 
-                       Generate ();
+               /// <summary>
+               /// If both ImplementationTypes and PrivateImplementationType are set,
+               /// then only ImplementationTypes are output.
+               /// </summary>
+               [Test]
+               public override void MethodImplementationTypeOrder ()
+               {
+                       string code = GenerateMethodImplementationTypeOrder (Options);
                        Assert.AreEqual (string.Format (CultureInfo.InvariantCulture,
-                               "public class Test1 {{{0}"
-                               + "    {0}"
-                               + "    public Test1(object value1, out int value2) : {0}"
-                               + "            base(value1, value2) {{{0}"
-                               + "    }}{0}"
-                               + "}}{0}", writer.NewLine), Code);
+                               "public class Test1 {{{0}" +
+                               "    {0}" +
+                               "    int System.Int32.Execute(object value1) {{{0}" +
+                               "    }}{0}" +
+                               "}}{0}", NewLine), code);
                }
 
                [Test]
-               public void ChainedConstructorSingleArg ()
+               public override void MethodReturnTypeAttributes ()
                {
-                       type.Name = "Test1";
+                       string code = GenerateMethodReturnTypeAttributes (Options);
+                       Assert.AreEqual (string.Format (CultureInfo.InvariantCulture,
+                               "public class Test1 {{{0}" +
+                               "    {0}" +
+                               "    [A()]{0}" +
+                               "    [B()]{0}" +
+                               "    [return: C(A1=false, A2=true)]{0}" +
+                               "    [return: D()]{0}" +
+                               "    public virtual int Execute() {{{0}" +
+                               "    }}{0}" +
+                               "}}{0}", NewLine), code);
+               }
 
-                       CodeConstructor ctor = new CodeConstructor ();
-                       ctor.Name = "Something";
-                       ctor.Attributes = MemberAttributes.Public;
+               [Test]
+               public override void MethodNewSlotTest ()
+               {
+                       string code = GenerateMethodNewSlot (Options);
+                       Assert.AreEqual (string.Format (CultureInfo.InvariantCulture,
+                               "public class Test1 {{{0}" +
+                               "    {0}" +
+                               "    public new virtual int Execute() {{{0}" +
+                               "    }}{0}" +
+                               "}}{0}", NewLine), code);
+               }
 
-                       // first parameter
-                       CodeParameterDeclarationExpression param = new CodeParameterDeclarationExpression (
-                               typeof (object), "value1");
-                       ctor.Parameters.Add (param);
+               [Test]
+               public override void ConstructorAttributesTest ()
+               {
+                       string code = GenerateConstructorAttributes (Options);
+                       Assert.AreEqual (string.Format (CultureInfo.InvariantCulture,
+                               "public class Test1 {{{0}" +
+                               "    {0}" +
+                               "    [A()]{0}" +
+                               "    [B()]{0}" +
+                               "    private Test1() {{{0}" +
+                               "    }}{0}" +
+                               "}}{0}", NewLine), code);
+               }
 
-                       // second parameter
-                       param = new CodeParameterDeclarationExpression (typeof (int), "value2");
-                       param.Direction = FieldDirection.Out;
-                       ctor.Parameters.Add (param);
+               [Test]
+               public void ConstructorAttributesTest_C ()
+               {
+                       CodeGeneratorOptions options = new CodeGeneratorOptions ();
+                       options.BracingStyle = "C";
 
-                       // chained ctor args
-                       ctor.ChainedConstructorArgs.Add (new CodeVariableReferenceExpression ("value1"));
+                       string code = GenerateConstructorAttributes (options);
+                       Assert.AreEqual (string.Format (CultureInfo.InvariantCulture,
+                               "public class Test1{0}" + 
+                               "{{{0}" +
+                               "    {0}" +
+                               "    [A()]{0}" +
+                               "    [B()]{0}" +
+                               "    private Test1(){0}" + 
+                               "    {{{0}" +
+                               "    }}{0}" +
+                               "}}{0}", NewLine), code);
+               }
 
-                       type.Members.Add (ctor);
+               [Test]
+               public override void ConstructorParametersTest ()
+               {
+                       string code = GenerateConstructorParameters (Options);
+                       Assert.AreEqual (string.Format (CultureInfo.InvariantCulture,
+                               "public class Test1 {{{0}" +
+                               "    {0}" +
+                               "    public Test1(object value1, object value2, out int index, ref int count) {{{0}" +
+                               "    }}{0}" +
+                               "}}{0}", NewLine), code);
+               }
 
-                       Generate ();
+               [Test]
+               public override void ConstructorParameterAttributesTest ()
+               {
+                       string code = GenerateConstructorParameterAttributes (Options);
                        Assert.AreEqual (string.Format (CultureInfo.InvariantCulture,
-                               "public class Test1 {{{0}"
-                               + "    {0}"
-                               + "    public Test1(object value1, out int value2) : {0}"
-                               + "            this(value1) {{{0}"
-                               + "    }}{0}"
-                               + "}}{0}", writer.NewLine), Code);
+                               "public class Test1 {{{0}" +
+                               "    {0}" +
+                               "    private Test1([A()] [B()] object value, [C(A1=false, A2=true)] [D()] out int index) {{{0}" +
+                               "    }}{0}" +
+                               "}}{0}", NewLine), code);
                }
 
                [Test]
-               public void ChainedConstructorMultipleArgs ()
+               public override void BaseConstructorSingleArg ()
                {
-                       type.Name = "Test1";
+                       string code = GenerateBaseConstructor (false, Options);
+                       Assert.AreEqual (string.Format (CultureInfo.InvariantCulture,
+                               "public class Test1 {{{0}" +
+                               "    {0}" +
+                               "    protected Test1(object value1, out int value2) : {0}" +
+                               "            base(value1) {{{0}" +
+                               "    }}{0}" +
+                               "}}{0}", NewLine), code);
+               }
 
-                       CodeConstructor ctor = new CodeConstructor ();
-                       ctor.Name = "Something";
-                       ctor.Attributes = MemberAttributes.Public;
+               [Test]
+               public override void BaseConstructorMultipleArgs ()
+               {
+                       string code = GenerateBaseConstructor (true, Options);
+                       Assert.AreEqual (string.Format (CultureInfo.InvariantCulture,
+                               "public class Test1 {{{0}" +
+                               "    {0}" +
+                               "    protected Test1(object value1, out int value2) : {0}" +
+                               "            base(value1, value2) {{{0}" +
+                               "    }}{0}" +
+                               "}}{0}", NewLine), code);
+               }
 
-                       // first parameter
-                       CodeParameterDeclarationExpression param = new CodeParameterDeclarationExpression (
-                               typeof (object), "value1");
-                       ctor.Parameters.Add (param);
+               [Test]
+               public override void ChainedConstructorSingleArg ()
+               {
+                       string code = GenerateChainedConstructor (false, Options);
+                       Assert.AreEqual (string.Format (CultureInfo.InvariantCulture,
+                               "public class Test1 {{{0}" +
+                               "    {0}" +
+                               "    public Test1(object value1, out int value2) : {0}" +
+                               "            base(value3) : {0}" +
+                               "            this(value1) {{{0}" +
+                               "    }}{0}" +
+                               "}}{0}", NewLine), code);
+               }
 
-                       // second parameter
-                       param = new CodeParameterDeclarationExpression (typeof (int), "value2");
-                       param.Direction = FieldDirection.Out;
-                       ctor.Parameters.Add (param);
+               [Test]
+               public override void ChainedConstructorMultipleArgs ()
+               {
+                       string code = GenerateChainedConstructor (true, Options);
+                       Assert.AreEqual (string.Format (CultureInfo.InvariantCulture,
+                               "public class Test1 {{{0}" +
+                               "    {0}" +
+                               "    public Test1(object value1, out int value2) : {0}" +
+                               "            base(value3) : {0}" +
+                               "            this(value1, value2) {{{0}" +
+                               "    }}{0}" +
+                               "}}{0}", NewLine), code);
+               }
 
-                       // chained ctor args
-                       ctor.ChainedConstructorArgs.Add (new CodeVariableReferenceExpression ("value1"));
-                       ctor.ChainedConstructorArgs.Add (new CodeVariableReferenceExpression ("value2"));
+               [Test]
+               public override void TypeConstructorTest ()
+               {
+                       string code = GenerateTypeConstructor (Options);
+                       Assert.AreEqual (string.Format (CultureInfo.InvariantCulture,
+                               "public class Test1 {{{0}" +
+                               "    {0}" +
+#if NET_2_0
+                               "    [A()]{0}" +
+                               "    [B()]{0}" +
+#endif
+                               "    static Test1() {{{0}" +
+                               "    }}{0}" +
+                               "}}{0}", NewLine), code);
+               }
 
-                       type.Members.Add (ctor);
+               [Test]
+               public void TypeConstructorTest_C ()
+               {
+                       CodeGeneratorOptions options = new CodeGeneratorOptions ();
+                       options.BracingStyle = "C";
 
-                       Generate ();
+                       string code = GenerateTypeConstructor (options);
                        Assert.AreEqual (string.Format (CultureInfo.InvariantCulture,
-                               "public class Test1 {{{0}"
-                               + "    {0}"
-                               + "    public Test1(object value1, out int value2) : {0}"
-                               + "            this(value1, value2) {{{0}"
-                               + "    }}{0}"
-                               + "}}{0}", writer.NewLine), Code);
+                               "public class Test1{0}" + 
+                               "{{{0}" +
+                               "    {0}" +
+#if NET_2_0
+                               "    [A()]{0}" +
+                               "    [B()]{0}" +
+#endif
+                               "    static Test1(){0}" + 
+                               "    {{{0}" +
+                               "    }}{0}" +
+                               "}}{0}", NewLine), code);
                }
 
                [Test]
-               public void BaseAndChainedConstructorArg ()
+               public override void EntryPointMethodTest ()
                {
-                       type.Name = "Test1";
+                       string code = GenerateEntryPointMethod (Options);
+                       Assert.AreEqual (string.Format (CultureInfo.InvariantCulture,
+                               "public class Test1 {{{0}" +
+                               "    {0}" +
+#if NET_2_0
+                               "    [A()]{0}" +
+                               "    public static int Main() {{{0}" +
+#else
+                               "    public static void Main() {{{0}" +
+#endif
+                               "        Test.InnerType x;{0}" +
+                               "    }}{0}" +
+                               "}}{0}", NewLine), code);
+               }
+
+               #endregion Override implementation of CodeGeneratorFromTypeTestBase
+       }
+
+       [TestFixture]
+       public class CodeGeneratorFromTypeTest_Delegate : CodeGeneratorFromTypeTestBase
+       {
+               private CodeTypeDeclaration _typeDeclaration;
+               private ICodeGenerator _codeGenerator;
 
-                       CodeConstructor ctor = new CodeConstructor ();
-                       ctor.Name = "Something";
-                       ctor.Attributes = MemberAttributes.Public;
+               #region Override implementation of CodeGeneratorTestBase
+               
+               protected override ICodeGenerator CodeGenerator
+               {
+                       get { return _codeGenerator; }
+               }
 
-                       // first parameter
-                       CodeParameterDeclarationExpression param = new CodeParameterDeclarationExpression (
-                               typeof (object), "value1");
-                       ctor.Parameters.Add (param);
+               [SetUp]
+               public override void SetUp ()
+               {
+                       base.SetUp ();
+                       _typeDeclaration = new CodeTypeDelegate ();
 
-                       // second parameter
-                       param = new CodeParameterDeclarationExpression (typeof (int), "value2");
-                       param.Direction = FieldDirection.Out;
-                       ctor.Parameters.Add (param);
+                       CodeDomProvider provider = new CSharpCodeProvider ();
+                       _codeGenerator = provider.CreateGenerator ();
+               }
 
-                       // base ctor args
-                       ctor.BaseConstructorArgs.Add (new CodeVariableReferenceExpression ("value1"));
+               #endregion Override implementation of CodeGeneratorTestBase
 
-                       // chained ctor args
-                       ctor.ChainedConstructorArgs.Add (new CodeVariableReferenceExpression ("value1"));
-                       ctor.ChainedConstructorArgs.Add (new CodeVariableReferenceExpression ("value2"));
+               #region Override implementation of CodeGeneratorFromTypeTestBase
 
-                       type.Members.Add (ctor);
+               protected override CodeTypeDeclaration TypeDeclaration
+               {
+                       get { return _typeDeclaration; }
+               }
 
-                       Generate ();
+               [Test]
+               public override void DefaultTypeTest ()
+               {
+                       string code = GenerateDefaultType (Options);
                        Assert.AreEqual (string.Format (CultureInfo.InvariantCulture,
-                               "public class Test1 {{{0}"
-                               + "    {0}"
-                               + "    public Test1(object value1, out int value2) : {0}"
-                               + "            base(value1) : {0}"
-                               + "            this(value1, value2) {{{0}"
-                               + "    }}{0}"
-                               + "}}{0}", writer.NewLine), Code);
+                               "public delegate void ();{0}", NewLine), code);
                }
 
-               /*
                [Test]
-               public void ReferencedTest ()
+               [ExpectedException (typeof (NullReferenceException))]
+               public override void NullTypeTest ()
                {
-                       codeUnit.ReferencedAssemblies.Add ("System.dll");
-                       Generate ();
-                       Assertion.AssertEquals ("", Code);
+                       GenerateNullType (Options);
                }
-               */
+
+               [Test]
+               public override void SimpleTypeTest ()
+               {
+                       string code = GenerateSimpleType (Options);
+                       Assert.AreEqual (string.Format (CultureInfo.InvariantCulture,
+                               "public delegate void Test1();{0}", NewLine), code);
+               }
+
+               [Test]
+               public override void DerivedTypeTest ()
+               {
+                       string code = GenerateDerivedType (Options);
+                       Assert.AreEqual (string.Format (CultureInfo.InvariantCulture,
+                               "delegate void Test1();{0}", NewLine), code);
+               }
+
+               [Test]
+               public override void AttributesAndTypeTest ()
+               {
+                       CodeTypeDelegate delegateDecl = new CodeTypeDelegate ();
+                       delegateDecl.ReturnType = new CodeTypeReference (typeof (int));
+
+                       _typeDeclaration = delegateDecl;
+
+                       string code = GenerateAttributesAndType (Options);
+                       Assert.AreEqual (string.Format (CultureInfo.InvariantCulture,
+                               "[A()]{0}" +
+                               "[B()]{0}" +
+                               "public delegate int Test1();{0}", NewLine), code);
+               }
+
+               [Test]
+               public override void EventMembersTypeTest1 ()
+               {
+                       string code = GenerateEventMembersType1 (Options);
+                       Assert.AreEqual (string.Format (CultureInfo.InvariantCulture,
+                               "public delegate void Test1();{0}{0}", NewLine), code);
+               }
+
+               [Test]
+               public override void EventMembersTypeTest2 ()
+               {
+                       string code = GenerateEventMembersType2 (Options);
+                       Assert.AreEqual (string.Format (CultureInfo.InvariantCulture,
+                               "public delegate void Test1();{0}{0}", NewLine), code);
+               }
+
+               [Test]
+               public override void EventImplementationTypes ()
+               {
+                       string code = GenerateEventImplementationTypes (Options);
+                       Assert.AreEqual (string.Format (CultureInfo.InvariantCulture,
+                               "public delegate void Test1();{0}{0}", NewLine), code);
+               }
+
+               /// <summary>
+               /// Ensure no access modifiers are output if PrivateImplementationType
+               /// is set.
+               /// </summary>
+               [Test]
+               public override void EventPrivateImplementationType ()
+               {
+                       string code = GenerateEventPrivateImplementationType (Options);
+                       Assert.AreEqual (string.Format (CultureInfo.InvariantCulture,
+                               "public delegate void Test1();{0}{0}", NewLine), code);
+               }
+
+               /// <summary>
+               /// If both ImplementationTypes and PrivateImplementationType are set,
+               /// then only ImplementationTypes are output.
+               /// </summary>
+               [Test]
+               public override void EventImplementationTypeOrder ()
+               {
+                       string code = GenerateEventImplementationTypeOrder (Options);
+                       Assert.AreEqual (string.Format (CultureInfo.InvariantCulture,
+                               "public delegate void Test1();{0}{0}", NewLine), code);
+               }
+
+               [Test]
+               public override void FieldMembersAttributesTest ()
+               {
+                       string code = GenerateFieldMembersAttributes (Options);
+                       Assert.AreEqual (string.Format (CultureInfo.InvariantCulture,
+                               "public delegate void Test1();{0}{0}", NewLine), code);
+               }
+
+               [Test]
+               public override void FieldMembersTypeTest ()
+               {
+                       string code = GenerateFieldMembersType (MemberAttributes.Public, Options);
+                       Assert.AreEqual (string.Format (CultureInfo.InvariantCulture,
+                               "public delegate void Test1();{0}{0}", NewLine), code);
+               }
+
+               [Test]
+               public override void FieldNewSlotTest ()
+               {
+                       string code = GenerateFieldMembersType (MemberAttributes.Assembly |
+                               MemberAttributes.New, Options);
+                       Assert.AreEqual (string.Format (CultureInfo.InvariantCulture,
+                               "public delegate void Test1();{0}{0}", NewLine), code);
+               }
+
+               [Test]
+               public override void PropertyMembersTypeTest1 ()
+               {
+                       string code = GeneratePropertyMembersAttributes (Options);
+                       Assert.AreEqual (string.Format (CultureInfo.InvariantCulture,
+                               "public delegate void Test1();{0}{0}", NewLine), code);
+               }
+
+               [Test]
+               public override void PropertyMembersTypeTest2 ()
+               {
+                       string code = GeneratePropertyMembersType (MemberAttributes.Public,
+                               false, false, Options);
+                       Assert.AreEqual (string.Format (CultureInfo.InvariantCulture,
+                               "public delegate void Test1();{0}{0}", NewLine), code);
+               }
+
+               [Test]
+               public override void PropertyMembersTypeGetOnly ()
+               {
+                       string code = GeneratePropertyMembersType (MemberAttributes.Family,
+                               true, false, Options);
+                       Assert.AreEqual (string.Format (CultureInfo.InvariantCulture,
+                               "public delegate void Test1();{0}{0}", NewLine), code);
+               }
+
+               [Test]
+               public override void PropertyMembersTypeSetOnly ()
+               {
+                       string code = GeneratePropertyMembersType (MemberAttributes.Assembly,
+                               false, true, Options);
+                       Assert.AreEqual (string.Format (CultureInfo.InvariantCulture,
+                               "public delegate void Test1();{0}{0}", NewLine), code);
+               }
+
+               [Test]
+               public override void PropertyMembersTypeGetSet ()
+               {
+                       string code = GeneratePropertyMembersType (MemberAttributes.Family,
+                               true, true, Options);
+                       Assert.AreEqual (string.Format (CultureInfo.InvariantCulture,
+                               "public delegate void Test1();{0}{0}", NewLine), code);
+               }
+
+               [Test]
+               public override void PropertyMembersTypeFamilyOrAssembly ()
+               {
+                       string code = GeneratePropertyMembersType (MemberAttributes.FamilyOrAssembly,
+                               false, false, Options);
+                       Assert.AreEqual (string.Format (CultureInfo.InvariantCulture,
+                               "public delegate void Test1();{0}{0}", NewLine), code);
+               }
+
+               [Test]
+               public override void PropertyMembersTypeAssembly ()
+               {
+                       string code = GeneratePropertyMembersType (MemberAttributes.Assembly,
+                               false, false, Options);
+                       Assert.AreEqual (string.Format (CultureInfo.InvariantCulture,
+                               "public delegate void Test1();{0}{0}", NewLine), code);
+               }
+
+               [Test]
+               public override void PropertyParametersTest ()
+               {
+                       string code = GeneratePropertyParameters (Options);
+                       Assert.AreEqual (string.Format (CultureInfo.InvariantCulture,
+                               "public delegate void Test1();{0}{0}", NewLine), code);
+               }
+
+               [Test]
+               public override void PropertyIndexerTest1 ()
+               {
+                       string code = GeneratePropertyIndexer (MemberAttributes.Public,
+                               false, false, true, Options);
+                       Assert.AreEqual (string.Format (CultureInfo.InvariantCulture,
+                               "public delegate void Test1();{0}{0}", NewLine), code);
+               }
+
+               [Test]
+               public override void PropertyIndexerTest2 ()
+               {
+                       string code = GeneratePropertyIndexer (MemberAttributes.Public,
+                               false, false, false, Options);
+                       Assert.AreEqual (string.Format (CultureInfo.InvariantCulture,
+                               "public delegate void Test1();{0}{0}", NewLine), code);
+               }
+
+               [Test]
+               public override void PropertyIndexerGetOnly ()
+               {
+                       string code = GeneratePropertyIndexer (MemberAttributes.Family,
+                               true, false, true, Options);
+                       Assert.AreEqual (string.Format (CultureInfo.InvariantCulture,
+                               "public delegate void Test1();{0}{0}", NewLine), code);
+               }
+
+               [Test]
+               public override void PropertyIndexerSetOnly ()
+               {
+                       string code = GeneratePropertyIndexer (MemberAttributes.Family,
+                               false, true, true, Options);
+                       Assert.AreEqual (string.Format (CultureInfo.InvariantCulture,
+                               "public delegate void Test1();{0}{0}", NewLine), code);
+               }
+
+               [Test]
+               public override void PropertyImplementationTypes ()
+               {
+                       string code = GeneratePropertyImplementationTypes (Options);
+                       Assert.AreEqual (string.Format (CultureInfo.InvariantCulture,
+                               "public delegate void Test1();{0}{0}", NewLine), code);
+               }
+
+               [Test]
+               public override void PropertyOverloadsTest1 ()
+               {
+                       string code = GeneratePropertyOverloads1 (Options);
+                       Assert.AreEqual (string.Format (CultureInfo.InvariantCulture,
+                               "public delegate void Test1();{0}{0}", NewLine), code);
+               }
+
+               [Test]
+               public override void PropertyOverloadsTest2 ()
+               {
+                       string code = GeneratePropertyOverloads2 (Options);
+                       Assert.AreEqual (string.Format (CultureInfo.InvariantCulture,
+                               "public delegate void Test1();{0}{0}{0}", NewLine), code);
+               }
+
+               [Test]
+               public override void PropertyOverloadsTest3 ()
+               {
+                       string code = GeneratePropertyOverloads3 (Options);
+                       Assert.AreEqual (string.Format (CultureInfo.InvariantCulture,
+                               "public delegate void Test1();{0}{0}{0}", NewLine), code);
+               }
+
+               [Test]
+               public override void PropertyPrivateImplementationType ()
+               {
+                       string code = GeneratePropertyPrivateImplementationType (Options);
+                       Assert.AreEqual (string.Format (CultureInfo.InvariantCulture,
+                               "public delegate void Test1();{0}{0}", NewLine), code);
+               }
+
+               [Test]
+               public override void PropertyImplementationTypeOrder ()
+               {
+                       string code = GeneratePropertyImplementationTypeOrder (Options);
+                       Assert.AreEqual (string.Format (CultureInfo.InvariantCulture,
+                               "public delegate void Test1();{0}{0}", NewLine), code);
+               }
+
+               [Test]
+               public override void PropertyNewSlotTest ()
+               {
+                       string code = GeneratePropertyMembersType (MemberAttributes.Private |
+                               MemberAttributes.New, true, true, Options);
+                       Assert.AreEqual (string.Format (CultureInfo.InvariantCulture,
+                               "public delegate void Test1();{0}{0}", NewLine), code);
+               }
+
+               [Test]
+               public override void MethodMembersTypeTest1 ()
+               {
+                       string code = GenerateMethodMembersType1 (Options);
+                       Assert.AreEqual (string.Format (CultureInfo.InvariantCulture,
+                               "public delegate void Test1();{0}{0}", NewLine), code);
+               }
+
+               [Test]
+               public override void MethodMembersTypeTest2 ()
+               {
+                       string code = GenerateMethodMembersType2 (Options);
+                       Assert.AreEqual (string.Format (CultureInfo.InvariantCulture,
+                               "public delegate void Test1();{0}{0}", NewLine), code);
+               }
+
+               [Test]
+               public override void MethodMembersTypeTest3 ()
+               {
+                       string code = GenerateMethodMembersType3 (Options);
+                       Assert.AreEqual (string.Format (CultureInfo.InvariantCulture,
+                               "public delegate void Test1();{0}{0}", NewLine), code);
+               }
+
+               [Test]
+               public override void MethodImplementationTypes ()
+               {
+                       string code = GenerateMethodImplementationTypes (Options);
+                       Assert.AreEqual (string.Format (CultureInfo.InvariantCulture,
+                               "public delegate void Test1();{0}{0}", NewLine), code);
+               }
+
+               [Test]
+               public override void MethodOverloadsTest1 ()
+               {
+                       string code = GenerateMethodOverloads1 (Options);
+                       Assert.AreEqual (string.Format (CultureInfo.InvariantCulture,
+                               "public delegate void Test1();{0}{0}", NewLine), code);
+               }
+
+               [Test]
+               public override void MethodOverloadsTest2 ()
+               {
+                       string code = GenerateMethodOverloads2 (Options);
+                       Assert.AreEqual (string.Format (CultureInfo.InvariantCulture,
+                               "public delegate void Test1();{0}{0}{0}", NewLine), code);
+               }
+
+               [Test]
+               public override void MethodOverloadsTest3 ()
+               {
+                       string code = GenerateMethodOverloads3 (Options);
+                       Assert.AreEqual (string.Format (CultureInfo.InvariantCulture,
+                               "public delegate void Test1();{0}{0}{0}", NewLine), code);
+               }
+
+               [Test]
+               public override void MethodPrivateImplementationType ()
+               {
+                       string code = GenerateMethodPrivateImplementationType (Options);
+                       Assert.AreEqual (string.Format (CultureInfo.InvariantCulture,
+                               "public delegate void Test1();{0}{0}", NewLine), code);
+               }
+
+               [Test]
+               public override void MethodImplementationTypeOrder ()
+               {
+                       string code = GenerateMethodImplementationTypeOrder (Options);
+                       Assert.AreEqual (string.Format (CultureInfo.InvariantCulture,
+                               "public delegate void Test1();{0}{0}", NewLine), code);
+               }
+
+               [Test]
+               public override void MethodReturnTypeAttributes ()
+               {
+                       string code = GenerateMethodReturnTypeAttributes (Options);
+                       Assert.AreEqual (string.Format (CultureInfo.InvariantCulture,
+                               "public delegate void Test1();{0}{0}", NewLine), code);
+               }
+
+               [Test]
+               public override void MethodNewSlotTest ()
+               {
+                       string code = GenerateMethodNewSlot (Options);
+                       Assert.AreEqual (string.Format (CultureInfo.InvariantCulture,
+                               "public delegate void Test1();{0}{0}", NewLine), code);
+               }
+
+               [Test]
+               public override void ConstructorAttributesTest ()
+               {
+                       string code = GenerateConstructorAttributes (Options);
+                       Assert.AreEqual (string.Format (CultureInfo.InvariantCulture,
+                               "public delegate void Test1();{0}{0}", NewLine), code);
+               }
+
+               [Test]
+               public override void ConstructorParametersTest ()
+               {
+                       string code = GenerateConstructorParameters (Options);
+                       Assert.AreEqual (string.Format (CultureInfo.InvariantCulture,
+                               "public delegate void Test1();{0}{0}", NewLine), code);
+               }
+
+               [Test]
+               public override void ConstructorParameterAttributesTest ()
+               {
+                       string code = GenerateConstructorParameterAttributes (Options);
+                       Assert.AreEqual (string.Format (CultureInfo.InvariantCulture,
+                               "public delegate void Test1();{0}{0}", NewLine), code);
+               }
+
+               [Test]
+               public override void BaseConstructorSingleArg ()
+               {
+                       string code = GenerateBaseConstructor (false, Options);
+                       Assert.AreEqual (string.Format (CultureInfo.InvariantCulture,
+                               "public delegate void Test1();{0}{0}", NewLine), code);
+               }
+
+               [Test]
+               public override void BaseConstructorMultipleArgs ()
+               {
+                       string code = GenerateBaseConstructor (true, Options);
+                       Assert.AreEqual (string.Format (CultureInfo.InvariantCulture,
+                               "public delegate void Test1();{0}{0}", NewLine), code);
+               }
+
+               [Test]
+               public override void ChainedConstructorSingleArg ()
+               {
+                       string code = GenerateChainedConstructor (false, Options);
+                       Assert.AreEqual (string.Format (CultureInfo.InvariantCulture,
+                               "public delegate void Test1();{0}{0}", NewLine), code);
+               }
+
+               [Test]
+               public override void ChainedConstructorMultipleArgs ()
+               {
+                       string code = GenerateChainedConstructor (true, Options);
+                       Assert.AreEqual (string.Format (CultureInfo.InvariantCulture,
+                               "public delegate void Test1();{0}{0}", NewLine), code);
+               }
+
+               [Test]
+               public override void TypeConstructorTest ()
+               {
+                       string code = GenerateTypeConstructor (Options);
+                       Assert.AreEqual (string.Format (CultureInfo.InvariantCulture,
+                               "public delegate void Test1();{0}{0}", NewLine), code);
+               }
+
+               [Test]
+               public override void EntryPointMethodTest ()
+               {
+                       string code = GenerateEntryPointMethod (Options);
+                       Assert.AreEqual (string.Format (CultureInfo.InvariantCulture,
+                               "public delegate void Test1();{0}{0}" +
+#if NET_2_0
+                               "[A()]{0}" +
+                               "public static int Main() {{{0}" +
+#else
+                               "public static void Main() {{{0}" +
+#endif
+                               "    Test.InnerType x;{0}" +
+                               "}}{0}", NewLine), code);
+               }
+
+               #endregion Override implementation of CodeGeneratorFromTypeTestBase
+       }
+
+       [TestFixture]
+       public class CodeGeneratorFromTypeTest_Interface : CodeGeneratorFromTypeTestBase
+       {
+               private CodeTypeDeclaration _typeDeclaration;
+               private ICodeGenerator _codeGenerator;
+
+               #region Override implementation of CodeGeneratorTestBase
+
+               protected override ICodeGenerator CodeGenerator
+               {
+                       get { return _codeGenerator; }
+               }
+
+               [SetUp]
+               public override void SetUp ()
+               {
+                       base.SetUp ();
+                       _typeDeclaration = new CodeTypeDeclaration ();
+                       _typeDeclaration.IsInterface = true;
+
+                       CodeDomProvider provider = new CSharpCodeProvider ();
+                       _codeGenerator = provider.CreateGenerator ();
+               }
+
+               #endregion Override implementation of CodeGeneratorTestBase
+
+               #region Override implementation of CodeGeneratorFromTypeTestBase
+
+               protected override CodeTypeDeclaration TypeDeclaration
+               {
+                       get { return _typeDeclaration; }
+               }
+
+               [Test]
+               public override void DefaultTypeTest ()
+               {
+                       string code = GenerateDefaultType (Options);
+                       Assert.AreEqual (string.Format (CultureInfo.InvariantCulture,
+                               "public interface  {{{0}" +
+                               "}}{0}", NewLine), code);
+               }
+
+               [Test]
+               public void DefaultTypeTest_C ()
+               {
+                       CodeGeneratorOptions options = new CodeGeneratorOptions ();
+                       options.BracingStyle = "C";
+
+                       string code = GenerateDefaultType (options);
+                       Assert.AreEqual (string.Format (CultureInfo.InvariantCulture,
+                               "public interface {0}" + 
+                               "{{{0}" +
+                               "}}{0}", NewLine), code);
+               }
+
+               [Test]
+               [ExpectedException (typeof (NullReferenceException))]
+               public override void NullTypeTest ()
+               {
+                       GenerateNullType (Options);
+               }
+
+               [Test]
+               public override void SimpleTypeTest ()
+               {
+                       string code = GenerateSimpleType (Options);
+                       Assert.AreEqual (string.Format (CultureInfo.InvariantCulture,
+                               "public interface Test1 {{{0}" +
+                               "}}{0}", NewLine), code);
+               }
+
+               [Test]
+               public void SimpleTypeTest_C ()
+               {
+                       CodeGeneratorOptions options = new CodeGeneratorOptions ();
+                       options.BracingStyle = "C";
+
+                       string code = GenerateSimpleType (options);
+                       Assert.AreEqual (string.Format (CultureInfo.InvariantCulture,
+                               "public interface Test1{0}" + 
+                               "{{{0}" +
+                               "}}{0}", NewLine), code);
+               }
+
+               [Test]
+               public override void DerivedTypeTest ()
+               {
+                       string code = GenerateDerivedType (Options);
+                       Assert.AreEqual (string.Format (CultureInfo.InvariantCulture,
+#if NET_2_0
+                               "internal interface Test1 : int, System.Security.Principal.IIdentity, string, System.Security.IPermission {{{0}" +
+#else
+                               "interface Test1 : int, System.Security.Principal.IIdentity, string, System.Security.IPermission {{{0}" +
+#endif
+                               "}}{0}", NewLine), code);
+               }
+
+               [Test]
+               public override void AttributesAndTypeTest ()
+               {
+                       string code = GenerateAttributesAndType (Options);
+                       Assert.AreEqual (string.Format (CultureInfo.InvariantCulture,
+                               "[A()]{0}" +
+                               "[B()]{0}" +
+                               "public interface Test1 {{{0}" +
+                               "}}{0}", NewLine), code);
+               }
+
+               [Test]
+               public override void EventMembersTypeTest1 ()
+               {
+                       string code = GenerateEventMembersType1 (Options);
+                       Assert.AreEqual (string.Format (CultureInfo.InvariantCulture,
+                               "public interface Test1 {{{0}" +
+                               "    {0}" +
+                               "    [A()]{0}" +
+                               "    [B()]{0}" +
+                               "    private event void ;{0}" +
+                               "}}{0}", NewLine), code);
+               }
+
+               [Test]
+               public override void EventMembersTypeTest2 ()
+               {
+                       string code = GenerateEventMembersType2 (Options);
+                       Assert.AreEqual (string.Format (CultureInfo.InvariantCulture,
+                               "public interface Test1 {{{0}" +
+                               "    {0}" +
+                               "    public event int Click;{0}" +
+                               "}}{0}", NewLine), code);
+               }
+
+               [Test]
+               public override void EventImplementationTypes ()
+               {
+                       string code = GenerateEventImplementationTypes (Options);
+                       Assert.AreEqual (string.Format (CultureInfo.InvariantCulture,
+                               "public interface Test1 {{{0}" +
+                               "    {0}" +
+#if NET_2_0
+                               "    internal event int Click;{0}" +
+#else
+                               "    /*FamANDAssem*/ internal event int Click;{0}" +
+#endif
+                               "}}{0}", NewLine), code);
+               }
+
+               [Test]
+               public override void EventPrivateImplementationType ()
+               {
+                       string code = GenerateEventPrivateImplementationType (Options);
+                       Assert.AreEqual (string.Format (CultureInfo.InvariantCulture,
+                               "public interface Test1 {{{0}" +
+                               "    {0}" +
+                               "    event int System.Int32.Click;{0}" +
+                               "}}{0}", NewLine), code);
+               }
+
+               [Test]
+               public override void EventImplementationTypeOrder ()
+               {
+                       string code = GenerateEventImplementationTypeOrder (Options);
+                       Assert.AreEqual (string.Format (CultureInfo.InvariantCulture,
+                               "public interface Test1 {{{0}" +
+                               "    {0}" +
+                               "    event int System.Int32.Click;{0}" +
+                               "}}{0}", NewLine), code);
+               }
+
+               [Test]
+               public override void FieldMembersAttributesTest ()
+               {
+                       string code = GenerateFieldMembersAttributes (Options);
+                       Assert.AreEqual (string.Format (CultureInfo.InvariantCulture,
+                               "public interface Test1 {{{0}" +
+                               "    {0}" +
+                               "}}{0}", NewLine), code);
+               }
+
+               [Test]
+               public override void FieldMembersTypeTest ()
+               {
+                       string code = GenerateFieldMembersType (MemberAttributes.Public, Options);
+                       Assert.AreEqual (string.Format (CultureInfo.InvariantCulture,
+                               "public interface Test1 {{{0}" +
+                               "    {0}" +
+                               "}}{0}", NewLine), code);
+               }
+
+               [Test]
+               public override void FieldNewSlotTest ()
+               {
+                       string code = GenerateFieldMembersType (MemberAttributes.Assembly |
+                               MemberAttributes.New, Options);
+                       Assert.AreEqual (string.Format (CultureInfo.InvariantCulture,
+                               "public interface Test1 {{{0}" +
+                               "    {0}" +
+                               "}}{0}", NewLine), code);
+               }
+
+               [Test]
+               public override void PropertyMembersTypeTest1 ()
+               {
+                       string code = GeneratePropertyMembersAttributes (Options);
+                       Assert.AreEqual (string.Format (CultureInfo.InvariantCulture,
+                               "public interface Test1 {{{0}" +
+                               "    {0}" +
+                               "    [A()]{0}" +
+                               "    [B()]{0}" +
+                               "    void  {{{0}" +
+                               "    }}{0}" +
+                               "}}{0}", NewLine), code);
+               }
+
+               [Test]
+               public override void PropertyMembersTypeTest2 ()
+               {
+                       string code = GeneratePropertyMembersType (MemberAttributes.Public,
+                               false, false, Options);
+                       Assert.AreEqual (string.Format (CultureInfo.InvariantCulture,
+                               "public interface Test1 {{{0}" +
+                               "    {0}" +
+                               "    int Name {{{0}" +
+                               "    }}{0}" +
+                               "}}{0}", NewLine), code);
+               }
+
+               [Test]
+               public override void PropertyMembersTypeGetOnly ()
+               {
+                       string code = GeneratePropertyMembersType (MemberAttributes.Family,
+                               true, false, Options);
+                       Assert.AreEqual (string.Format (CultureInfo.InvariantCulture,
+                               "public interface Test1 {{{0}" +
+                               "    {0}" +
+                               "    int Name {{{0}" +
+                               "        get;{0}" +
+                               "    }}{0}" +
+                               "}}{0}", NewLine), code);
+               }
+
+               [Test]
+               public override void PropertyMembersTypeSetOnly ()
+               {
+                       string code = GeneratePropertyMembersType (MemberAttributes.Assembly,
+                               false, true, Options);
+                       Assert.AreEqual (string.Format (CultureInfo.InvariantCulture,
+                               "public interface Test1 {{{0}" +
+                               "    {0}" +
+                               "    int Name {{{0}" +
+                               "        set;{0}" +
+                               "    }}{0}" +
+                               "}}{0}", NewLine), code);
+               }
+
+               [Test]
+               public override void PropertyMembersTypeGetSet ()
+               {
+                       string code = GeneratePropertyMembersType (MemberAttributes.Family,
+                               true, true, Options);
+                       Assert.AreEqual (string.Format (CultureInfo.InvariantCulture,
+                               "public interface Test1 {{{0}" +
+                               "    {0}" +
+                               "    int Name {{{0}" +
+                               "        get;{0}" +
+                               "        set;{0}" +
+                               "    }}{0}" +
+                               "}}{0}", NewLine), code);
+               }
+
+               [Test]
+               public void PropertyMembersTypeGetSet_C ()
+               {
+                       CodeGeneratorOptions options = new CodeGeneratorOptions ();
+                       options.BracingStyle = "C";
+
+                       string code = GeneratePropertyMembersType (MemberAttributes.Family,
+                               true, true, options);
+                       Assert.AreEqual (string.Format (CultureInfo.InvariantCulture,
+                               "public interface Test1{0}" + 
+                               "{{{0}" +
+                               "    {0}" +
+                               "    int Name{0}" + 
+                               "    {{{0}" +
+                               "        get;{0}" +
+                               "        set;{0}" +
+                               "    }}{0}" +
+                               "}}{0}", NewLine), code);
+               }
+
+               [Test]
+               public override void PropertyMembersTypeFamilyOrAssembly ()
+               {
+                       string code = GeneratePropertyMembersType (MemberAttributes.FamilyOrAssembly,
+                               false, false, Options);
+                       Assert.AreEqual (string.Format (CultureInfo.InvariantCulture,
+                               "public interface Test1 {{{0}" +
+                               "    {0}" +
+                               "    int Name {{{0}" +
+                               "    }}{0}" +
+                               "}}{0}", NewLine), code);
+               }
+
+               [Test]
+               public override void PropertyMembersTypeAssembly ()
+               {
+                       string code = GeneratePropertyMembersType (MemberAttributes.Assembly,
+                               false, false, Options);
+                       Assert.AreEqual (string.Format (CultureInfo.InvariantCulture,
+                               "public interface Test1 {{{0}" +
+                               "    {0}" +
+                               "    int Name {{{0}" +
+                               "    }}{0}" +
+                               "}}{0}", NewLine), code);
+               }
+
+               [Test]
+               public override void PropertyParametersTest ()
+               {
+                       string code = GeneratePropertyParameters (Options);
+                       Assert.AreEqual (string.Format (CultureInfo.InvariantCulture,
+                               "public interface Test1 {{{0}" +
+                               "    {0}" +
+                               "    int Name {{{0}" +
+                               "    }}{0}" +
+                               "}}{0}", NewLine), code);
+               }
+
+               [Test]
+               public override void PropertyIndexerTest1 ()
+               {
+                       string code = GeneratePropertyIndexer (MemberAttributes.Public,
+                               false, false, true, Options);
+                       Assert.AreEqual (string.Format (CultureInfo.InvariantCulture,
+                               "public interface Test1 {{{0}" +
+                               "    {0}" +
+                               "    int this[object value1, ref int value2] {{{0}" +
+                               "    }}{0}" +
+                               "}}{0}", NewLine), code);
+               }
+
+               [Test]
+               public override void PropertyIndexerTest2 ()
+               {
+                       string code = GeneratePropertyIndexer (MemberAttributes.Public,
+                               false, false, false, Options);
+                       Assert.AreEqual (string.Format (CultureInfo.InvariantCulture,
+                               "public interface Test1 {{{0}" +
+                               "    {0}" +
+                               "    int iTem {{{0}" +
+                               "    }}{0}" +
+                               "}}{0}", NewLine), code);
+               }
+
+               [Test]
+               public override void PropertyIndexerGetOnly ()
+               {
+                       string code = GeneratePropertyIndexer (MemberAttributes.Family,
+                               true, false, true, Options);
+                       Assert.AreEqual (string.Format (CultureInfo.InvariantCulture,
+                               "public interface Test1 {{{0}" +
+                               "    {0}" +
+                               "    int this[object value1, ref int value2] {{{0}" +
+                               "        get;{0}" +
+                               "    }}{0}" +
+                               "}}{0}", NewLine), code);
+               }
+
+               [Test]
+               public override void PropertyIndexerSetOnly ()
+               {
+                       string code = GeneratePropertyIndexer (MemberAttributes.Family,
+                               false, true, true, Options);
+                       Assert.AreEqual (string.Format (CultureInfo.InvariantCulture,
+                               "public interface Test1 {{{0}" +
+                               "    {0}" +
+                               "    int this[object value1, ref int value2] {{{0}" +
+                               "        set;{0}" +
+                               "    }}{0}" +
+                               "}}{0}", NewLine), code);
+               }
+
+               [Test]
+               public override void PropertyImplementationTypes ()
+               {
+                       string code = GeneratePropertyImplementationTypes (Options);
+                       Assert.AreEqual (string.Format (CultureInfo.InvariantCulture,
+                               "public interface Test1 {{{0}" +
+                               "    {0}" +
+                               "    int Name {{{0}" +
+                               "    }}{0}" +
+                               "}}{0}", NewLine), code);
+               }
+
+               [Test]
+               public override void PropertyOverloadsTest1 ()
+               {
+                       string code = GeneratePropertyOverloads1 (Options);
+                       Assert.AreEqual (string.Format (CultureInfo.InvariantCulture,
+                               "public interface Test1 {{{0}" +
+                               "    {0}" +
+                               "    int Name {{{0}" +
+                               "    }}{0}" +
+                               "}}{0}", NewLine), code);
+               }
+
+               [Test]
+               public override void PropertyOverloadsTest2 ()
+               {
+                       string code = GeneratePropertyOverloads2 (Options);
+                       Assert.AreEqual (string.Format (CultureInfo.InvariantCulture,
+                               "public interface Test1 {{{0}" +
+                               "    {0}" +
+                               "    int Name {{{0}" +
+                               "    }}{0}" +
+                               "    {0}" +
+                               "    int Name {{{0}" +
+                               "    }}{0}" +
+                               "}}{0}", NewLine), code);
+               }
+
+               [Test]
+               public override void PropertyOverloadsTest3 ()
+               {
+                       string code = GeneratePropertyOverloads3 (Options);
+                       Assert.AreEqual (string.Format (CultureInfo.InvariantCulture,
+                               "public interface Test1 {{{0}" +
+                               "    {0}" +
+                               "    int Name {{{0}" +
+                               "    }}{0}" +
+                               "    {0}" +
+                               "    int Name {{{0}" +
+                               "    }}{0}" +
+                               "}}{0}", NewLine), code);
+               }
+
+               [Test]
+               public override void PropertyPrivateImplementationType ()
+               {
+                       string code = GeneratePropertyPrivateImplementationType (Options);
+                       Assert.AreEqual (string.Format (CultureInfo.InvariantCulture,
+                               "public interface Test1 {{{0}" +
+                               "    {0}" +
+                               "    int this[object value1] {{{0}" +
+                               "    }}{0}" +
+                               "}}{0}", NewLine), code);
+               }
+
+               [Test]
+               public override void PropertyImplementationTypeOrder ()
+               {
+                       string code = GeneratePropertyImplementationTypeOrder (Options);
+                       Assert.AreEqual (string.Format (CultureInfo.InvariantCulture,
+                               "public interface Test1 {{{0}" +
+                               "    {0}" +
+                               "    int this[object value1] {{{0}" +
+                               "    }}{0}" +
+                               "}}{0}", NewLine), code);
+               }
+
+               [Test]
+               public override void PropertyNewSlotTest ()
+               {
+                       string code = GeneratePropertyMembersType (MemberAttributes.Private |
+                               MemberAttributes.New, true, true, Options);
+                       Assert.AreEqual (string.Format (CultureInfo.InvariantCulture,
+                               "public interface Test1 {{{0}" +
+                               "    {0}" +
+                               "    new int Name {{{0}" +
+                               "        get;{0}" +
+                               "        set;{0}" +
+                               "    }}{0}" +
+                               "}}{0}", NewLine), code);
+               }
+
+               [Test]
+               public override void MethodMembersTypeTest1 ()
+               {
+                       string code = GenerateMethodMembersType1 (Options);
+                       Assert.AreEqual (string.Format (CultureInfo.InvariantCulture,
+                               "public interface Test1 {{{0}" +
+                               "    {0}" +
+                               "    [A()]{0}" +
+                               "    [B()]{0}" +
+                               "    void ();{0}" +
+                               "}}{0}", NewLine), code);
+               }
+
+               [Test]
+               public void MethodMembersTypeTest1_C ()
+               {
+                       CodeGeneratorOptions options = new CodeGeneratorOptions ();
+                       options.BracingStyle = "C";
+
+                       string code = GenerateMethodMembersType1 (options);
+                       Assert.AreEqual (string.Format (CultureInfo.InvariantCulture,
+                               "public interface Test1{0}" + 
+                               "{{{0}" +
+                               "    {0}" +
+                               "    [A()]{0}" +
+                               "    [B()]{0}" +
+                               "    void ();{0}" +
+                               "}}{0}", NewLine), code);
+               }
+
+               [Test]
+               public override void MethodMembersTypeTest2 ()
+               {
+                       string code = GenerateMethodMembersType2 (Options);
+                       Assert.AreEqual (string.Format (CultureInfo.InvariantCulture,
+                               "public interface Test1 {{{0}" +
+                               "    {0}" +
+                               "    int Something(object value1, object value2, out int index, ref int count);{0}" +
+                               "}}{0}", NewLine), code);
+               }
+
+               [Test]
+               public override void MethodMembersTypeTest3 ()
+               {
+                       string code = GenerateMethodMembersType3 (Options);
+                       Assert.AreEqual (string.Format (CultureInfo.InvariantCulture,
+                               "public interface Test1 {{{0}" +
+                               "    {0}" +
+                               "    int Something([A()] [B()] object value, [C(A1=false, A2=true)] [D()] out int index);{0}" +
+                               "}}{0}", NewLine), code);
+               }
+
+               [Test]
+               public override void MethodImplementationTypes ()
+               {
+                       string code = GenerateMethodImplementationTypes (Options);
+                       Assert.AreEqual (string.Format (CultureInfo.InvariantCulture,
+                               "public interface Test1 {{{0}" +
+                               "    {0}" +
+                               "    int Execute();{0}" +
+                               "}}{0}", NewLine), code);
+               }
+
+               [Test]
+               public override void MethodOverloadsTest1 ()
+               {
+                       string code = GenerateMethodOverloads1 (Options);
+                       Assert.AreEqual (string.Format (CultureInfo.InvariantCulture,
+                               "public interface Test1 {{{0}" +
+                               "    {0}" +
+                               "    int Execute();{0}" +
+                               "}}{0}", NewLine), code);
+               }
+
+               [Test]
+               public override void MethodOverloadsTest2 ()
+               {
+                       string code = GenerateMethodOverloads2 (Options);
+                       Assert.AreEqual (string.Format (CultureInfo.InvariantCulture,
+                               "public interface Test1 {{{0}" +
+                               "    {0}" +
+                               "    void Execute();{0}" +
+                               "    {0}" +
+                               "    int Execute(object value1);{0}" +
+                               "}}{0}", NewLine), code);
+               }
+
+               [Test]
+               public override void MethodOverloadsTest3 ()
+               {
+                       string code = GenerateMethodOverloads3 (Options);
+                       Assert.AreEqual (string.Format (CultureInfo.InvariantCulture,
+                               "public interface Test1 {{{0}" +
+                               "    {0}" +
+                               "    void Execute();{0}" +
+                               "    {0}" +
+                               "    int System.Int32.Execute(object value1);{0}" +
+                               "}}{0}", NewLine), code);
+               }
+
+               [Test]
+               public override void MethodPrivateImplementationType ()
+               {
+                       string code = GenerateMethodPrivateImplementationType (Options);
+                       Assert.AreEqual (string.Format (CultureInfo.InvariantCulture,
+                               "public interface Test1 {{{0}" +
+                               "    {0}" +
+                               "    int System.Int32.Execute(object value1);{0}" +
+                               "}}{0}", NewLine), code);
+               }
+
+               [Test]
+               public override void MethodImplementationTypeOrder ()
+               {
+                       string code = GenerateMethodImplementationTypeOrder (Options);
+                       Assert.AreEqual (string.Format (CultureInfo.InvariantCulture,
+                               "public interface Test1 {{{0}" +
+                               "    {0}" +
+                               "    int System.Int32.Execute(object value1);{0}" +
+                               "}}{0}", NewLine), code);
+               }
+
+               [Test]
+               public override void MethodReturnTypeAttributes ()
+               {
+                       string code = GenerateMethodReturnTypeAttributes (Options);
+                       Assert.AreEqual (string.Format (CultureInfo.InvariantCulture,
+                               "public interface Test1 {{{0}" +
+                               "    {0}" +
+                               "    [A()]{0}" +
+                               "    [B()]{0}" +
+                               "    [return: C(A1=false, A2=true)]{0}" +
+                               "    [return: D()]{0}" +
+                               "    int Execute();{0}" +
+                               "}}{0}", NewLine), code);
+               }
+
+               [Test]
+               public override void MethodNewSlotTest ()
+               {
+                       string code = GenerateMethodNewSlot (Options);
+                       Assert.AreEqual (string.Format (CultureInfo.InvariantCulture,
+                               "public interface Test1 {{{0}" +
+                               "    {0}" +
+                               "    new int Execute();{0}" +
+                               "}}{0}", NewLine), code);
+               }
+
+               [Test]
+               public override void ConstructorAttributesTest ()
+               {
+                       string code = GenerateConstructorAttributes (Options);
+                       Assert.AreEqual (string.Format (CultureInfo.InvariantCulture,
+                               "public interface Test1 {{{0}" +
+                               "    {0}" +
+                               "}}{0}", NewLine), code);
+               }
+
+               [Test]
+               public void ConstructorAttributesTest_C ()
+               {
+                       CodeGeneratorOptions options = new CodeGeneratorOptions ();
+                       options.BracingStyle = "C";
+
+                       string code = GenerateConstructorAttributes (options);
+                       Assert.AreEqual (string.Format (CultureInfo.InvariantCulture,
+                               "public interface Test1{0}" + 
+                               "{{{0}" +
+                               "    {0}" +
+                               "}}{0}", NewLine), code);
+               }
+
+               [Test]
+               public override void ConstructorParametersTest ()
+               {
+                       string code = GenerateConstructorParameters (Options);
+                       Assert.AreEqual (string.Format (CultureInfo.InvariantCulture,
+                               "public interface Test1 {{{0}" +
+                               "    {0}" +
+                               "}}{0}", NewLine), code);
+               }
+
+               [Test]
+               public override void ConstructorParameterAttributesTest ()
+               {
+                       string code = GenerateConstructorParameterAttributes (Options);
+                       Assert.AreEqual (string.Format (CultureInfo.InvariantCulture,
+                               "public interface Test1 {{{0}" +
+                               "    {0}" +
+                               "}}{0}", NewLine), code, "#1");
+               }
+
+               [Test]
+               public override void BaseConstructorSingleArg ()
+               {
+                       string code = GenerateBaseConstructor (false, Options);
+                       Assert.AreEqual (string.Format (CultureInfo.InvariantCulture,
+                               "public interface Test1 {{{0}" +
+                               "    {0}" +
+                               "}}{0}", NewLine), code);
+               }
+
+               [Test]
+               public override void BaseConstructorMultipleArgs ()
+               {
+                       string code = GenerateBaseConstructor (true, Options);
+                       Assert.AreEqual (string.Format (CultureInfo.InvariantCulture,
+                               "public interface Test1 {{{0}" +
+                               "    {0}" +
+                               "}}{0}", NewLine), code);
+               }
+
+               [Test]
+               public override void ChainedConstructorSingleArg ()
+               {
+                       string code = GenerateChainedConstructor (false, Options);
+                       Assert.AreEqual (string.Format (CultureInfo.InvariantCulture,
+                               "public interface Test1 {{{0}" +
+                               "    {0}" +
+                               "}}{0}", NewLine), code);
+               }
+
+               [Test]
+               public override void ChainedConstructorMultipleArgs ()
+               {
+                       string code = GenerateChainedConstructor (true, Options);
+                       Assert.AreEqual (string.Format (CultureInfo.InvariantCulture,
+                               "public interface Test1 {{{0}" +
+                               "    {0}" +
+                               "}}{0}", NewLine), code);
+               }
+
+               [Test]
+               public override void TypeConstructorTest ()
+               {
+                       string code = GenerateTypeConstructor (Options);
+                       Assert.AreEqual (string.Format (CultureInfo.InvariantCulture,
+                               "public interface Test1 {{{0}" +
+                               "    {0}" +
+                               "}}{0}", NewLine), code);
+               }
+
+               [Test]
+               public void TypeConstructorTest_C ()
+               {
+                       CodeGeneratorOptions options = new CodeGeneratorOptions ();
+                       options.BracingStyle = "C";
+
+                       string code = GenerateTypeConstructor (options);
+                       Assert.AreEqual (string.Format (CultureInfo.InvariantCulture,
+                               "public interface Test1{0}" + 
+                               "{{{0}" +
+                               "    {0}" +
+                               "}}{0}", NewLine), code);
+               }
+
+               [Test]
+               public override void EntryPointMethodTest ()
+               {
+                       string code = GenerateEntryPointMethod (Options);
+                       Assert.AreEqual (string.Format (CultureInfo.InvariantCulture,
+                               "public interface Test1 {{{0}" + 
+                               "    {0}" +
+#if NET_2_0
+                               "    [A()]{0}" +
+                               "    public static int Main() {{{0}" +
+#else
+                               "    public static void Main() {{{0}" +
+#endif
+                               "        Test.InnerType x;{0}" +
+                               "    }}{0}" +
+                               "}}{0}", NewLine), code);
+               }
+
+               #endregion Override implementation of CodeGeneratorFromTypeTestBase
+       }
+
+       [TestFixture]
+       public class CodeGeneratorFromTypeTest_Struct : CodeGeneratorFromTypeTestBase
+       {
+               private CodeTypeDeclaration _typeDeclaration;
+               private ICodeGenerator _codeGenerator;
+
+               #region Override implementation of CodeGeneratorTestBase
+
+               protected override ICodeGenerator CodeGenerator
+               {
+                       get { return _codeGenerator; }
+               }
+
+               [SetUp]
+               public override void SetUp ()
+               {
+                       base.SetUp ();
+                       _typeDeclaration = new CodeTypeDeclaration ();
+                       _typeDeclaration.IsStruct = true;
+
+                       CodeDomProvider provider = new CSharpCodeProvider ();
+                       _codeGenerator = provider.CreateGenerator ();
+               }
+
+               #endregion Override implementation of CodeGeneratorTestBase
+
+               #region Override implementation of CodeGeneratorFromTypeTestBase
+
+               protected override CodeTypeDeclaration TypeDeclaration
+               {
+                       get { return _typeDeclaration; }
+               }
+
+               [Test]
+               public override void DefaultTypeTest ()
+               {
+                       string code = GenerateDefaultType (Options);
+                       Assert.AreEqual (string.Format (CultureInfo.InvariantCulture,
+                               "public struct  {{{0}" +
+                               "}}{0}", NewLine), code);
+               }
+
+               [Test]
+               public void DefaultTypeTest_C ()
+               {
+                       CodeGeneratorOptions options = new CodeGeneratorOptions ();
+                       options.BracingStyle = "C";
+
+                       string code = GenerateDefaultType (options);
+                       Assert.AreEqual (string.Format (CultureInfo.InvariantCulture,
+                               "public struct {0}" + 
+                               "{{{0}" +
+                               "}}{0}", NewLine), code);
+               }
+
+               [Test]
+               [ExpectedException (typeof (NullReferenceException))]
+               public override void NullTypeTest ()
+               {
+                       GenerateNullType (Options);
+               }
+
+               [Test]
+               public override void SimpleTypeTest ()
+               {
+                       string code = GenerateSimpleType (Options);
+                       Assert.AreEqual (string.Format (CultureInfo.InvariantCulture,
+                               "public struct Test1 {{{0}" +
+                               "}}{0}", NewLine), code);
+               }
+
+               [Test]
+               public void SimpleTypeTest_C ()
+               {
+                       CodeGeneratorOptions options = new CodeGeneratorOptions ();
+                       options.BracingStyle = "C";
+
+                       string code = GenerateSimpleType (options);
+                       Assert.AreEqual (string.Format (CultureInfo.InvariantCulture,
+                               "public struct Test1{0}" + 
+                               "{{{0}" +
+                               "}}{0}", NewLine), code);
+               }
+
+               [Test]
+               public override void DerivedTypeTest ()
+               {
+                       string code = GenerateDerivedType (Options);
+                       Assert.AreEqual (string.Format (CultureInfo.InvariantCulture,
+#if NET_2_0
+                               "internal struct Test1 : int, System.Security.Principal.IIdentity, string, System.Security.IPermission {{{0}" +
+#else
+                               "struct Test1 : int, System.Security.Principal.IIdentity, string, System.Security.IPermission {{{0}" +
+#endif
+                               "}}{0}", NewLine), code);
+               }
+
+               [Test]
+               public override void AttributesAndTypeTest ()
+               {
+                       string code = GenerateAttributesAndType (Options);
+                       Assert.AreEqual (string.Format (CultureInfo.InvariantCulture,
+                               "[A()]{0}" +
+                               "[B()]{0}" +
+                               "public struct Test1 {{{0}" +
+                               "}}{0}", NewLine), code);
+               }
+
+               [Test]
+               public override void EventMembersTypeTest1 ()
+               {
+                       string code = GenerateEventMembersType1 (Options);
+                       Assert.AreEqual (string.Format (CultureInfo.InvariantCulture,
+                               "public struct Test1 {{{0}" +
+                               "    {0}" +
+                               "    [A()]{0}" +
+                               "    [B()]{0}" +
+                               "    private event void ;{0}" +
+                               "}}{0}", NewLine), code);
+               }
+
+               [Test]
+               public override void EventMembersTypeTest2 ()
+               {
+                       string code = GenerateEventMembersType2 (Options);
+                       Assert.AreEqual (string.Format (CultureInfo.InvariantCulture,
+                               "public struct Test1 {{{0}" +
+                               "    {0}" +
+                               "    public event int Click;{0}" +
+                               "}}{0}", NewLine), code);
+               }
+
+               [Test]
+               public override void EventImplementationTypes ()
+               {
+                       string code = GenerateEventImplementationTypes (Options);
+                       Assert.AreEqual (string.Format (CultureInfo.InvariantCulture,
+                               "public struct Test1 {{{0}" +
+                               "    {0}" +
+#if NET_2_0
+                               "    internal event int Click;{0}" +
+#else
+                               "    /*FamANDAssem*/ internal event int Click;{0}" +
+#endif
+                               "}}{0}", NewLine), code);
+               }
+
+               [Test]
+               public override void EventPrivateImplementationType ()
+               {
+                       string code = GenerateEventPrivateImplementationType (Options);
+                       Assert.AreEqual (string.Format (CultureInfo.InvariantCulture,
+                               "public struct Test1 {{{0}" +
+                               "    {0}" +
+                               "    event int System.Int32.Click;{0}" +
+                               "}}{0}", NewLine), code);
+               }
+
+               [Test]
+               public override void EventImplementationTypeOrder ()
+               {
+                       string code = GenerateEventImplementationTypeOrder (Options);
+                       Assert.AreEqual (string.Format (CultureInfo.InvariantCulture,
+                               "public struct Test1 {{{0}" +
+                               "    {0}" +
+                               "    event int System.Int32.Click;{0}" +
+                               "}}{0}", NewLine), code);
+               }
+
+               [Test]
+               public override void FieldMembersAttributesTest ()
+               {
+                       string code = GenerateFieldMembersAttributes (Options);
+                       Assert.AreEqual (string.Format (CultureInfo.InvariantCulture,
+                               "public struct Test1 {{{0}" +
+                               "    {0}" +
+                               "    [A()]{0}" +
+                               "    [B()]{0}" +
+                               "    private void ;{0}" +
+                               "}}{0}", NewLine), code);
+               }
+
+               [Test]
+               public override void FieldMembersTypeTest ()
+               {
+                       string code = GenerateFieldMembersType (MemberAttributes.Public, Options);
+                       Assert.AreEqual (string.Format (CultureInfo.InvariantCulture,
+                               "public struct Test1 {{{0}" +
+                               "    {0}" +
+                               "    public int Name = 2;{0}" +
+                               "}}{0}", NewLine), code);
+               }
+
+               [Test]
+               public override void FieldNewSlotTest ()
+               {
+                       string code = GenerateFieldMembersType (MemberAttributes.Assembly |
+                               MemberAttributes.New, Options);
+                       Assert.AreEqual (string.Format (CultureInfo.InvariantCulture,
+                               "public struct Test1 {{{0}" +
+                               "    {0}" +
+                               "    internal new int Name = 2;{0}" +
+                               "}}{0}", NewLine), code);
+               }
+
+               [Test]
+               public override void PropertyMembersTypeTest1 ()
+               {
+                       string code = GeneratePropertyMembersAttributes (Options);
+                       Assert.AreEqual (string.Format (CultureInfo.InvariantCulture,
+                               "public struct Test1 {{{0}" +
+                               "    {0}" +
+                               "    [A()]{0}" +
+                               "    [B()]{0}" +
+                               "    private void  {{{0}" +
+                               "    }}{0}" +
+                               "}}{0}", NewLine), code);
+               }
+
+               [Test]
+               public override void PropertyMembersTypeTest2 ()
+               {
+                       string code = GeneratePropertyMembersType (MemberAttributes.Public,
+                               false, false, Options);
+                       Assert.AreEqual (string.Format (CultureInfo.InvariantCulture,
+                               "public struct Test1 {{{0}" +
+                               "    {0}" +
+                               "    public virtual int Name {{{0}" +
+                               "    }}{0}" +
+                               "}}{0}", NewLine), code);
+               }
+
+               [Test]
+               public override void PropertyMembersTypeGetOnly ()
+               {
+                       string code = GeneratePropertyMembersType (MemberAttributes.Family,
+                               true, false, Options);
+                       Assert.AreEqual (string.Format (CultureInfo.InvariantCulture,
+                               "public struct Test1 {{{0}" +
+                               "    {0}" +
+                               "    protected virtual int Name {{{0}" +
+                               "        get {{{0}" +
+                               "        }}{0}" +
+                               "    }}{0}" +
+                               "}}{0}", NewLine), code);
+               }
+
+               [Test]
+               public override void PropertyMembersTypeSetOnly ()
+               {
+                       string code = GeneratePropertyMembersType (MemberAttributes.Assembly,
+                               false, true, Options);
+                       Assert.AreEqual (string.Format (CultureInfo.InvariantCulture,
+                               "public struct Test1 {{{0}" +
+                               "    {0}" +
+#if NET_2_0
+                               "    internal virtual int Name {{{0}" +
+#else
+                               "    internal int Name {{{0}" +
+#endif
+                               "        set {{{0}" +
+                               "        }}{0}" +
+                               "    }}{0}" +
+                               "}}{0}", NewLine), code);
+               }
+
+               [Test]
+               public override void PropertyMembersTypeGetSet ()
+               {
+                       string code = GeneratePropertyMembersType (MemberAttributes.Family,
+                               true, true, Options);
+                       Assert.AreEqual (string.Format (CultureInfo.InvariantCulture,
+                               "public struct Test1 {{{0}" +
+                               "    {0}" +
+                               "    protected virtual int Name {{{0}" +
+                               "        get {{{0}" +
+                               "        }}{0}" +
+                               "        set {{{0}" +
+                               "        }}{0}" +
+                               "    }}{0}" +
+                               "}}{0}", NewLine), code);
+               }
+
+               [Test]
+               public void PropertyMembersTypeGetSet_C ()
+               {
+                       CodeGeneratorOptions options = new CodeGeneratorOptions ();
+                       options.BracingStyle = "C";
+
+                       string code = GeneratePropertyMembersType (MemberAttributes.Family,
+                               true, true, options);
+                       Assert.AreEqual (string.Format (CultureInfo.InvariantCulture,
+                               "public struct Test1{0}" + 
+                               "{{{0}" +
+                               "    {0}" +
+                               "    protected virtual int Name{0}" + 
+                               "    {{{0}" +
+                               "        get{0}" + 
+                               "        {{{0}" +
+                               "        }}{0}" +
+                               "        set{0}" + 
+                               "        {{{0}" +
+                               "        }}{0}" +
+                               "    }}{0}" +
+                               "}}{0}", NewLine), code);
+               }
+
+               [Test]
+               public override void PropertyMembersTypeFamilyOrAssembly ()
+               {
+                       string code = GeneratePropertyMembersType (MemberAttributes.FamilyOrAssembly,
+                               false, false, Options);
+                       Assert.AreEqual (string.Format (CultureInfo.InvariantCulture,
+                               "public struct Test1 {{{0}" +
+                               "    {0}" +
+                               "    protected internal int Name {{{0}" +
+                               "    }}{0}" +
+                               "}}{0}", NewLine), code);
+               }
+
+               [Test]
+               public override void PropertyMembersTypeAssembly ()
+               {
+                       string code = GeneratePropertyMembersType (MemberAttributes.Assembly,
+                               false, false, Options);
+                       Assert.AreEqual (string.Format (CultureInfo.InvariantCulture,
+                               "public struct Test1 {{{0}" +
+                               "    {0}" +
+#if NET_2_0
+                               "    internal virtual int Name {{{0}" +
+#else
+                               "    internal int Name {{{0}" +
+#endif
+                               "    }}{0}" +
+                               "}}{0}", NewLine), code);
+               }
+
+               [Test]
+               public override void PropertyParametersTest ()
+               {
+                       string code = GeneratePropertyParameters (Options);
+                       Assert.AreEqual (string.Format (CultureInfo.InvariantCulture,
+                               "public struct Test1 {{{0}" +
+                               "    {0}" +
+                               "    public virtual int Name {{{0}" +
+                               "    }}{0}" +
+                               "}}{0}", NewLine), code);
+               }
+
+               [Test]
+               public override void PropertyIndexerTest1 ()
+               {
+                       string code = GeneratePropertyIndexer (MemberAttributes.Public,
+                               false, false, true, Options);
+                       Assert.AreEqual (string.Format (CultureInfo.InvariantCulture,
+                               "public struct Test1 {{{0}" +
+                               "    {0}" +
+                               "    public virtual int this[object value1, ref int value2] {{{0}" +
+                               "    }}{0}" +
+                               "}}{0}", NewLine), code);
+               }
+
+               [Test]
+               public override void PropertyIndexerTest2 ()
+               {
+                       string code = GeneratePropertyIndexer (MemberAttributes.Public,
+                               false, false, false, Options);
+                       Assert.AreEqual (string.Format (CultureInfo.InvariantCulture,
+                               "public struct Test1 {{{0}" +
+                               "    {0}" +
+                               "    public virtual int iTem {{{0}" +
+                               "    }}{0}" +
+                               "}}{0}", NewLine), code);
+               }
+
+               [Test]
+               public override void PropertyIndexerGetOnly ()
+               {
+                       string code = GeneratePropertyIndexer (MemberAttributes.Family,
+                               true, false, true, Options);
+                       Assert.AreEqual (string.Format (CultureInfo.InvariantCulture,
+                               "public struct Test1 {{{0}" +
+                               "    {0}" +
+                               "    protected virtual int this[object value1, ref int value2] {{{0}" +
+                               "        get {{{0}" +
+                               "        }}{0}" +
+                               "    }}{0}" +
+                               "}}{0}", NewLine), code);
+               }
+
+               [Test]
+               public override void PropertyIndexerSetOnly ()
+               {
+                       string code = GeneratePropertyIndexer (MemberAttributes.Family,
+                               false, true, true, Options);
+                       Assert.AreEqual (string.Format (CultureInfo.InvariantCulture,
+                               "public struct Test1 {{{0}" +
+                               "    {0}" +
+                               "    protected virtual int this[object value1, ref int value2] {{{0}" +
+                               "        set {{{0}" +
+                               "        }}{0}" +
+                               "    }}{0}" +
+                               "}}{0}", NewLine), code);
+               }
+
+               [Test]
+               public override void PropertyImplementationTypes ()
+               {
+                       string code = GeneratePropertyImplementationTypes (Options);
+                       Assert.AreEqual (string.Format (CultureInfo.InvariantCulture,
+                               "public struct Test1 {{{0}" +
+                               "    {0}" +
+                               "    public virtual int Name {{{0}" +
+                               "    }}{0}" +
+                               "}}{0}", NewLine), code);
+               }
+
+               [Test]
+               public override void PropertyOverloadsTest1 ()
+               {
+                       string code = GeneratePropertyOverloads1 (Options);
+                       Assert.AreEqual (string.Format (CultureInfo.InvariantCulture,
+                               "public struct Test1 {{{0}" +
+                               "    {0}" +
+                               "    protected virtual int Name {{{0}" +
+                               "    }}{0}" +
+                               "}}{0}", NewLine), code);
+               }
+
+               [Test]
+               public override void PropertyOverloadsTest2 ()
+               {
+                       string code = GeneratePropertyOverloads2 (Options);
+                       Assert.AreEqual (string.Format (CultureInfo.InvariantCulture,
+                               "public struct Test1 {{{0}" +
+                               "    {0}" +
+                               "    public virtual int Name {{{0}" +
+                               "    }}{0}" +
+                               "    {0}" +
+                               "    private int Name {{{0}" +
+                               "    }}{0}" +
+                               "}}{0}", NewLine), code);
+               }
+
+               [Test]
+               public override void PropertyOverloadsTest3 ()
+               {
+                       string code = GeneratePropertyOverloads3 (Options);
+                       Assert.AreEqual (string.Format (CultureInfo.InvariantCulture,
+                               "public struct Test1 {{{0}" +
+                               "    {0}" +
+                               "    public virtual int Name {{{0}" +
+                               "    }}{0}" +
+                               "    {0}" +
+                               "    int System.Int32.Name {{{0}" +
+                               "    }}{0}" +
+                               "}}{0}", NewLine), code);
+               }
+
+               [Test]
+               public override void PropertyPrivateImplementationType ()
+               {
+                       string code = GeneratePropertyPrivateImplementationType (Options);
+                       Assert.AreEqual (string.Format (CultureInfo.InvariantCulture,
+                               "public struct Test1 {{{0}" +
+                               "    {0}" +
+                               "    int System.Int32.this[object value1] {{{0}" +
+                               "    }}{0}" +
+                               "}}{0}", NewLine), code);
+               }
+
+               [Test]
+               public override void PropertyImplementationTypeOrder ()
+               {
+                       string code = GeneratePropertyImplementationTypeOrder (Options);
+                       Assert.AreEqual (string.Format (CultureInfo.InvariantCulture,
+                               "public struct Test1 {{{0}" +
+                               "    {0}" +
+                               "    int System.Int32.this[object value1] {{{0}" +
+                               "    }}{0}" +
+                               "}}{0}", NewLine), code);
+               }
+
+               [Test]
+               public override void PropertyNewSlotTest ()
+               {
+                       string code = GeneratePropertyMembersType (MemberAttributes.Private |
+                               MemberAttributes.New, true, true, Options);
+                       Assert.AreEqual (string.Format (CultureInfo.InvariantCulture,
+                               "public struct Test1 {{{0}" +
+                               "    {0}" +
+                               "    private new int Name {{{0}" +
+                               "        get {{{0}" +
+                               "        }}{0}" +
+                               "        set {{{0}" +
+                               "        }}{0}" +
+                               "    }}{0}" +
+                               "}}{0}", NewLine), code);
+               }
+
+               [Test]
+               public override void MethodMembersTypeTest1 ()
+               {
+                       string code = GenerateMethodMembersType1 (Options);
+                       Assert.AreEqual (string.Format (CultureInfo.InvariantCulture,
+                               "public struct Test1 {{{0}" +
+                               "    {0}" +
+                               "    [A()]{0}" +
+                               "    [B()]{0}" +
+                               "    private void () {{{0}" +
+                               "    }}{0}" +
+                               "}}{0}", NewLine), code);
+               }
+
+               [Test]
+               public void MethodMembersTypeTest1_C ()
+               {
+                       CodeGeneratorOptions options = new CodeGeneratorOptions ();
+                       options.BracingStyle = "C";
+
+                       string code = GenerateMethodMembersType1 (options);
+                       Assert.AreEqual (string.Format (CultureInfo.InvariantCulture,
+                               "public struct Test1{0}" + 
+                               "{{{0}" +
+                               "    {0}" +
+                               "    [A()]{0}" +
+                               "    [B()]{0}" +
+                               "    private void (){0}" + 
+                               "    {{{0}" +
+                               "    }}{0}" +
+                               "}}{0}", NewLine), code);
+               }
+
+               [Test]
+               public override void MethodMembersTypeTest2 ()
+               {
+                       string code = GenerateMethodMembersType2 (Options);
+                       Assert.AreEqual (string.Format (CultureInfo.InvariantCulture,
+                               "public struct Test1 {{{0}" +
+                               "    {0}" +
+                               "    public virtual int Something(object value1, object value2, out int index, ref int count) {{{0}" +
+                               "    }}{0}" +
+                               "}}{0}", NewLine), code);
+               }
+
+               [Test]
+               public override void MethodMembersTypeTest3 ()
+               {
+                       string code = GenerateMethodMembersType3 (Options);
+                       Assert.AreEqual (string.Format (CultureInfo.InvariantCulture,
+                               "public struct Test1 {{{0}" +
+                               "    {0}" +
+                               "    public virtual int Something([A()] [B()] object value, [C(A1=false, A2=true)] [D()] out int index) {{{0}" +
+                               "    }}{0}" +
+                               "}}{0}", NewLine), code);
+               }
+
+               [Test]
+               public override void MethodImplementationTypes ()
+               {
+                       string code = GenerateMethodImplementationTypes (Options);
+                       Assert.AreEqual (string.Format (CultureInfo.InvariantCulture,
+                               "public struct Test1 {{{0}" +
+                               "    {0}" +
+#if NET_2_0
+                               "    internal virtual int Execute() {{{0}" +
+#else
+                               "    internal int Execute() {{{0}" +
+#endif
+                               "    }}{0}" +
+                               "}}{0}", NewLine), code);
+               }
+
+               [Test]
+               public override void MethodOverloadsTest1 ()
+               {
+                       string code = GenerateMethodOverloads1 (Options);
+                       Assert.AreEqual (string.Format (CultureInfo.InvariantCulture,
+                               "public struct Test1 {{{0}" +
+                               "    {0}" +
+#if NET_2_0
+                               "    internal virtual int Execute() {{{0}" +
+#else
+                               "    internal int Execute() {{{0}" +
+#endif
+                               "    }}{0}" +
+                               "}}{0}", NewLine), code);
+               }
+
+               [Test]
+               public override void MethodOverloadsTest2 ()
+               {
+                       string code = GenerateMethodOverloads2 (Options);
+                       Assert.AreEqual (string.Format (CultureInfo.InvariantCulture,
+                               "public struct Test1 {{{0}" +
+                               "    {0}" +
+                               "    public virtual void Execute() {{{0}" +
+                               "    }}{0}" +
+                               "    {0}" +
+                               "    private int Execute(object value1) {{{0}" +
+                               "    }}{0}" +
+                               "}}{0}", NewLine), code);
+               }
+
+               [Test]
+               public override void MethodOverloadsTest3 ()
+               {
+                       string code = GenerateMethodOverloads3 (Options);
+                       Assert.AreEqual (string.Format (CultureInfo.InvariantCulture,
+                               "public struct Test1 {{{0}" +
+                               "    {0}" +
+                               "    public virtual void Execute() {{{0}" +
+                               "    }}{0}" +
+                               "    {0}" +
+                               "    int System.Int32.Execute(object value1) {{{0}" +
+                               "    }}{0}" +
+                               "}}{0}", NewLine), code);
+               }
+
+               [Test]
+               public override void MethodPrivateImplementationType ()
+               {
+                       string code = GenerateMethodPrivateImplementationType (Options);
+                       Assert.AreEqual (string.Format (CultureInfo.InvariantCulture,
+                               "public struct Test1 {{{0}" +
+                               "    {0}" +
+                               "    int System.Int32.Execute(object value1) {{{0}" +
+                               "    }}{0}" +
+                               "}}{0}", NewLine), code);
+               }
+
+               [Test]
+               public override void MethodImplementationTypeOrder ()
+               {
+                       string code = GenerateMethodImplementationTypeOrder (Options);
+                       Assert.AreEqual (string.Format (CultureInfo.InvariantCulture,
+                               "public struct Test1 {{{0}" +
+                               "    {0}" +
+                               "    int System.Int32.Execute(object value1) {{{0}" +
+                               "    }}{0}" +
+                               "}}{0}", NewLine), code);
+               }
+
+               [Test]
+               public override void MethodReturnTypeAttributes ()
+               {
+                       string code = GenerateMethodReturnTypeAttributes (Options);
+                       Assert.AreEqual (string.Format (CultureInfo.InvariantCulture,
+                               "public struct Test1 {{{0}" +
+                               "    {0}" +
+                               "    [A()]{0}" +
+                               "    [B()]{0}" +
+                               "    [return: C(A1=false, A2=true)]{0}" +
+                               "    [return: D()]{0}" +
+                               "    public virtual int Execute() {{{0}" +
+                               "    }}{0}" +
+                               "}}{0}", NewLine), code);
+               }
+
+               [Test]
+               public override void MethodNewSlotTest ()
+               {
+                       string code = GenerateMethodNewSlot (Options);
+                       Assert.AreEqual (string.Format (CultureInfo.InvariantCulture,
+                               "public struct Test1 {{{0}" +
+                               "    {0}" +
+                               "    public new virtual int Execute() {{{0}" +
+                               "    }}{0}" +
+                               "}}{0}", NewLine), code);
+               }
+
+               [Test]
+               public override void ConstructorAttributesTest ()
+               {
+                       string code = GenerateConstructorAttributes (Options);
+                       Assert.AreEqual (string.Format (CultureInfo.InvariantCulture,
+                               "public struct Test1 {{{0}" +
+                               "    {0}" +
+                               "    [A()]{0}" +
+                               "    [B()]{0}" +
+                               "    private Test1() {{{0}" +
+                               "    }}{0}" +
+                               "}}{0}", NewLine), code);
+               }
+
+               [Test]
+               public void ConstructorAttributesTest_C ()
+               {
+                       CodeGeneratorOptions options = new CodeGeneratorOptions ();
+                       options.BracingStyle = "C";
+
+                       string code = GenerateConstructorAttributes (options);
+                       Assert.AreEqual (string.Format (CultureInfo.InvariantCulture,
+                               "public struct Test1{0}" + 
+                               "{{{0}" +
+                               "    {0}" +
+                               "    [A()]{0}" +
+                               "    [B()]{0}" +
+                               "    private Test1(){0}" + 
+                               "    {{{0}" +
+                               "    }}{0}" +
+                               "}}{0}", NewLine), code);
+               }
+
+               [Test]
+               public override void ConstructorParametersTest ()
+               {
+                       string code = GenerateConstructorParameters (Options);
+                       Assert.AreEqual (string.Format (CultureInfo.InvariantCulture,
+                               "public struct Test1 {{{0}" +
+                               "    {0}" +
+                               "    public Test1(object value1, object value2, out int index, ref int count) {{{0}" +
+                               "    }}{0}" +
+                               "}}{0}", NewLine), code);
+               }
+
+               [Test]
+               public override void ConstructorParameterAttributesTest ()
+               {
+                       string code = GenerateConstructorParameterAttributes (Options);
+                       Assert.AreEqual (string.Format (CultureInfo.InvariantCulture,
+                               "public struct Test1 {{{0}" +
+                               "    {0}" +
+                               "    private Test1([A()] [B()] object value, [C(A1=false, A2=true)] [D()] out int index) {{{0}" +
+                               "    }}{0}" +
+                               "}}{0}", NewLine), code);
+               }
+
+               [Test]
+               public override void BaseConstructorSingleArg ()
+               {
+                       string code = GenerateBaseConstructor (false, Options);
+                       Assert.AreEqual (string.Format (CultureInfo.InvariantCulture,
+                               "public struct Test1 {{{0}" +
+                               "    {0}" +
+                               "    protected Test1(object value1, out int value2) : {0}" +
+                               "            base(value1) {{{0}" +
+                               "    }}{0}" +
+                               "}}{0}", NewLine), code);
+               }
+
+               [Test]
+               public override void BaseConstructorMultipleArgs ()
+               {
+                       string code = GenerateBaseConstructor (true, Options);
+                       Assert.AreEqual (string.Format (CultureInfo.InvariantCulture,
+                               "public struct Test1 {{{0}" +
+                               "    {0}" +
+                               "    protected Test1(object value1, out int value2) : {0}" +
+                               "            base(value1, value2) {{{0}" +
+                               "    }}{0}" +
+                               "}}{0}", NewLine), code);
+               }
+
+               [Test]
+               public override void ChainedConstructorSingleArg ()
+               {
+                       string code = GenerateChainedConstructor (false, Options);
+                       Assert.AreEqual (string.Format (CultureInfo.InvariantCulture,
+                               "public struct Test1 {{{0}" +
+                               "    {0}" +
+                               "    public Test1(object value1, out int value2) : {0}" +
+                               "            base(value3) : {0}" +
+                               "            this(value1) {{{0}" +
+                               "    }}{0}" +
+                               "}}{0}", NewLine), code);
+               }
+
+               [Test]
+               public override void ChainedConstructorMultipleArgs ()
+               {
+                       string code = GenerateChainedConstructor (true, Options);
+                       Assert.AreEqual (string.Format (CultureInfo.InvariantCulture,
+                               "public struct Test1 {{{0}" +
+                               "    {0}" +
+                               "    public Test1(object value1, out int value2) : {0}" +
+                               "            base(value3) : {0}" +
+                               "            this(value1, value2) {{{0}" +
+                               "    }}{0}" +
+                               "}}{0}", NewLine), code);
+               }
+
+               [Test]
+               public override void TypeConstructorTest ()
+               {
+                       string code = GenerateTypeConstructor (Options);
+                       Assert.AreEqual (string.Format (CultureInfo.InvariantCulture,
+                               "public struct Test1 {{{0}" +
+                               "    {0}" +
+#if NET_2_0
+                               "    [A()]{0}" +
+                               "    [B()]{0}" +
+#endif
+                               "    static Test1() {{{0}" +
+                               "    }}{0}" +
+                               "}}{0}", NewLine), code, "#1");
+               }
+
+               [Test]
+               public void TypeConstructorTest_C ()
+               {
+                       CodeGeneratorOptions options = new CodeGeneratorOptions ();
+                       options.BracingStyle = "C";
+
+                       string code = GenerateTypeConstructor (options);
+                       Assert.AreEqual (string.Format (CultureInfo.InvariantCulture,
+                               "public struct Test1{0}" +
+                               "{{{0}" +
+                               "    {0}" +
+#if NET_2_0
+                               "    [A()]{0}" +
+                               "    [B()]{0}" +
+#endif
+                               "    static Test1(){0}" + 
+                               "    {{{0}" +
+                               "    }}{0}" +
+                               "}}{0}", NewLine), code, "#2");
+               }
+
+               [Test]
+               public override void EntryPointMethodTest ()
+               {
+                       string code = GenerateEntryPointMethod (Options);
+                       Assert.AreEqual (string.Format (CultureInfo.InvariantCulture,
+                               "public struct Test1 {{{0}" +
+                               "    {0}" +
+#if NET_2_0
+                               "    [A()]{0}" +
+                               "    public static int Main() {{{0}" +
+#else
+                               "    public static void Main() {{{0}" +
+#endif
+                               "        Test.InnerType x;{0}" +
+                               "    }}{0}" +
+                               "}}{0}", NewLine), code);
+               }
+
+               #endregion Override implementation of CodeGeneratorFromTypeTestBase
+       }
+
+       [TestFixture]
+       public class CodeGeneratorFromTypeTest_Enum : CodeGeneratorFromTypeTestBase
+       {
+               private CodeTypeDeclaration _typeDeclaration;
+               private ICodeGenerator _codeGenerator;
+
+               #region Override implementation of CodeGeneratorTestBase
+
+               protected override ICodeGenerator CodeGenerator
+               {
+                       get { return _codeGenerator; }
+               }
+
+               [SetUp]
+               public override void SetUp ()
+               {
+                       base.SetUp ();
+                       _typeDeclaration = new CodeTypeDeclaration ();
+                       _typeDeclaration.IsEnum = true;
+
+                       CodeDomProvider provider = new CSharpCodeProvider ();
+                       _codeGenerator = provider.CreateGenerator ();
+               }
+
+               #endregion Override implementation of CodeGeneratorTestBase
+
+               #region Override implementation of CodeGeneratorFromTypeTestBase
+
+               protected override CodeTypeDeclaration TypeDeclaration
+               {
+                       get { return _typeDeclaration; }
+               }
+
+               [Test]
+               public override void DefaultTypeTest ()
+               {
+                       string code = GenerateDefaultType (Options);
+                       Assert.AreEqual (string.Format (CultureInfo.InvariantCulture,
+                               "public enum  {{{0}" +
+                               "}}{0}", NewLine), code);
+               }
+
+               [Test]
+               public void DefaultTypeTest_C ()
+               {
+                       CodeGeneratorOptions options = new CodeGeneratorOptions ();
+                       options.BracingStyle = "C";
+
+                       string code = GenerateDefaultType (options);
+                       Assert.AreEqual (string.Format (CultureInfo.InvariantCulture,
+                               "public enum {0}" + 
+                               "{{{0}" +
+                               "}}{0}", NewLine), code);
+               }
+
+               [Test]
+               [ExpectedException (typeof (NullReferenceException))]
+               public override void NullTypeTest ()
+               {
+                       GenerateNullType (Options);
+               }
+
+               [Test]
+               public override void SimpleTypeTest ()
+               {
+                       string code = GenerateSimpleType (Options);
+                       Assert.AreEqual (string.Format (CultureInfo.InvariantCulture,
+                               "public enum Test1 {{{0}" +
+                               "}}{0}", NewLine), code);
+               }
+
+               [Test]
+               public void SimpleTypeTest_C ()
+               {
+                       CodeGeneratorOptions options = new CodeGeneratorOptions ();
+                       options.BracingStyle = "C";
+
+                       string code = GenerateSimpleType (options);
+                       Assert.AreEqual (string.Format (CultureInfo.InvariantCulture,
+                               "public enum Test1{0}" + 
+                               "{{{0}" +
+                               "}}{0}", NewLine), code);
+               }
+
+               [Test]
+               public override void DerivedTypeTest ()
+               {
+                       string code = GenerateDerivedType (Options);
+                       Assert.AreEqual (string.Format (CultureInfo.InvariantCulture,
+#if NET_2_0
+                               "internal enum Test1 : int, System.Security.Principal.IIdentity, string, System.Security.IPermission {{{0}" +
+#else
+                               "enum Test1 : int, System.Security.Principal.IIdentity, string, System.Security.IPermission {{{0}" +
+#endif
+                               "}}{0}", NewLine), code);
+               }
+
+               [Test]
+               public override void AttributesAndTypeTest ()
+               {
+                       string code = GenerateAttributesAndType (Options);
+                       Assert.AreEqual (string.Format (CultureInfo.InvariantCulture,
+                               "[A()]{0}" +
+                               "[B()]{0}" +
+                               "public enum Test1 {{{0}" +
+                               "}}{0}", NewLine), code);
+               }
+
+               [Test]
+               public override void EventMembersTypeTest1 ()
+               {
+                       string code = GenerateEventMembersType1 (Options);
+                       Assert.AreEqual (string.Format (CultureInfo.InvariantCulture,
+                               "public enum Test1 {{{0}" +
+                               "    {0}" +
+                               "}}{0}", NewLine), code);
+               }
+
+               [Test]
+               public override void EventMembersTypeTest2 ()
+               {
+                       string code = GenerateEventMembersType2 (Options);
+                       Assert.AreEqual (string.Format (CultureInfo.InvariantCulture,
+                               "public enum Test1 {{{0}" +
+                               "    {0}" +
+                               "}}{0}", NewLine), code);
+               }
+
+               [Test]
+               public override void EventImplementationTypes ()
+               {
+                       string code = GenerateEventImplementationTypes (Options);
+                       Assert.AreEqual (string.Format (CultureInfo.InvariantCulture,
+                               "public enum Test1 {{{0}" +
+                               "    {0}" +
+                               "}}{0}", NewLine), code);
+               }
+
+               [Test]
+               public override void EventPrivateImplementationType ()
+               {
+                       string code = GenerateEventPrivateImplementationType (Options);
+                       Assert.AreEqual (string.Format (CultureInfo.InvariantCulture,
+                               "public enum Test1 {{{0}" +
+                               "    {0}" +
+                               "}}{0}", NewLine), code);
+               }
+
+               [Test]
+               public override void EventImplementationTypeOrder ()
+               {
+                       string code = GenerateEventImplementationTypeOrder (Options);
+                       Assert.AreEqual (string.Format (CultureInfo.InvariantCulture,
+                               "public enum Test1 {{{0}" +
+                               "    {0}" +
+                               "}}{0}", NewLine), code);
+               }
+
+               [Test]
+               public override void FieldMembersAttributesTest ()
+               {
+                       string code = GenerateFieldMembersAttributes (Options);
+                       Assert.AreEqual (string.Format (CultureInfo.InvariantCulture,
+                               "public enum Test1 {{{0}" +
+                               "    {0}" +
+                               "    [A()]{0}" +
+                               "    [B()]{0}" +
+                               "    ,{0}" +
+                               "}}{0}", NewLine), code);
+               }
+
+               [Test]
+               public override void FieldMembersTypeTest ()
+               {
+                       string code = GenerateFieldMembersType (MemberAttributes.Public, Options);
+                       Assert.AreEqual (string.Format (CultureInfo.InvariantCulture,
+                               "public enum Test1 {{{0}" +
+                               "    {0}" +
+                               "    Name = 2,{0}" +
+                               "}}{0}", NewLine), code);
+               }
+
+               [Test]
+               public override void FieldNewSlotTest ()
+               {
+                       string code = GenerateFieldMembersType (MemberAttributes.Assembly |
+                               MemberAttributes.New, Options);
+                       Assert.AreEqual (string.Format (CultureInfo.InvariantCulture,
+                               "public enum Test1 {{{0}" +
+                               "    {0}" +
+                               "    Name = 2,{0}" +
+                               "}}{0}", NewLine), code);
+               }
+
+               [Test]
+               public override void PropertyMembersTypeTest1 ()
+               {
+                       string code = GeneratePropertyMembersAttributes (Options);
+                       Assert.AreEqual (string.Format (CultureInfo.InvariantCulture,
+                               "public enum Test1 {{{0}" +
+                               "    {0}" +
+                               "}}{0}", NewLine), code);
+               }
+
+               [Test]
+               public override void PropertyMembersTypeTest2 ()
+               {
+                       string code = GeneratePropertyMembersType (MemberAttributes.Public,
+                               false, false, Options);
+                       Assert.AreEqual (string.Format (CultureInfo.InvariantCulture,
+                               "public enum Test1 {{{0}" +
+                               "    {0}" +
+                               "}}{0}", NewLine), code);
+               }
+
+               [Test]
+               public override void PropertyMembersTypeGetOnly ()
+               {
+                       string code = GeneratePropertyMembersType (MemberAttributes.Family,
+                               true, false, Options);
+                       Assert.AreEqual (string.Format (CultureInfo.InvariantCulture,
+                               "public enum Test1 {{{0}" +
+                               "    {0}" +
+                               "}}{0}", NewLine), code);
+               }
+
+               [Test]
+               public override void PropertyMembersTypeSetOnly ()
+               {
+                       string code = GeneratePropertyMembersType (MemberAttributes.Assembly,
+                               false, true, Options);
+                       Assert.AreEqual (string.Format (CultureInfo.InvariantCulture,
+                               "public enum Test1 {{{0}" +
+                               "    {0}" +
+                               "}}{0}", NewLine), code);
+               }
+
+               [Test]
+               public override void PropertyMembersTypeGetSet ()
+               {
+                       string code = GeneratePropertyMembersType (MemberAttributes.Family,
+                               true, true, Options);
+                       Assert.AreEqual (string.Format (CultureInfo.InvariantCulture,
+                               "public enum Test1 {{{0}" +
+                               "    {0}" +
+                               "}}{0}", NewLine), code);
+               }
+
+               [Test]
+               public void PropertyMembersTypeGetSet_C ()
+               {
+                       CodeGeneratorOptions options = new CodeGeneratorOptions ();
+                       options.BracingStyle = "C";
+
+                       string code = GeneratePropertyMembersType (MemberAttributes.Family,
+                               true, true, options);
+                       Assert.AreEqual (string.Format (CultureInfo.InvariantCulture,
+                               "public enum Test1{0}" + 
+                               "{{{0}" +
+                               "    {0}" +
+                               "}}{0}", NewLine), code);
+               }
+
+               [Test]
+               public override void PropertyMembersTypeFamilyOrAssembly ()
+               {
+                       string code = GeneratePropertyMembersType (MemberAttributes.FamilyOrAssembly,
+                               false, false, Options);
+                       Assert.AreEqual (string.Format (CultureInfo.InvariantCulture,
+                               "public enum Test1 {{{0}" +
+                               "    {0}" +
+                               "}}{0}", NewLine), code);
+               }
+
+               [Test]
+               public override void PropertyMembersTypeAssembly ()
+               {
+                       string code = GeneratePropertyMembersType (MemberAttributes.Assembly,
+                               false, false, Options);
+                       Assert.AreEqual (string.Format (CultureInfo.InvariantCulture,
+                               "public enum Test1 {{{0}" +
+                               "    {0}" +
+                               "}}{0}", NewLine), code);
+               }
+
+               [Test]
+               public override void PropertyParametersTest ()
+               {
+                       string code = GeneratePropertyParameters (Options);
+                       Assert.AreEqual (string.Format (CultureInfo.InvariantCulture,
+                               "public enum Test1 {{{0}" +
+                               "    {0}" +
+                               "}}{0}", NewLine), code);
+               }
+
+               [Test]
+               public override void PropertyIndexerTest1 ()
+               {
+                       string code = GeneratePropertyIndexer (MemberAttributes.Public,
+                               false, false, true, Options);
+                       Assert.AreEqual (string.Format (CultureInfo.InvariantCulture,
+                               "public enum Test1 {{{0}" +
+                               "    {0}" +
+                               "}}{0}", NewLine), code);
+               }
+
+               [Test]
+               public override void PropertyIndexerTest2 ()
+               {
+                       string code = GeneratePropertyIndexer (MemberAttributes.Public,
+                               false, false, false, Options);
+                       Assert.AreEqual (string.Format (CultureInfo.InvariantCulture,
+                               "public enum Test1 {{{0}" +
+                               "    {0}" +
+                               "}}{0}", NewLine), code);
+               }
+
+               [Test]
+               public override void PropertyIndexerGetOnly ()
+               {
+                       string code = GeneratePropertyIndexer (MemberAttributes.Family,
+                               true, false, true, Options);
+                       Assert.AreEqual (string.Format (CultureInfo.InvariantCulture,
+                               "public enum Test1 {{{0}" +
+                               "    {0}" +
+                               "}}{0}", NewLine), code);
+               }
+
+               [Test]
+               public override void PropertyIndexerSetOnly ()
+               {
+                       string code = GeneratePropertyIndexer (MemberAttributes.Family,
+                               false, true, true, Options);
+                       Assert.AreEqual (string.Format (CultureInfo.InvariantCulture,
+                               "public enum Test1 {{{0}" +
+                               "    {0}" +
+                               "}}{0}", NewLine), code);
+               }
+
+               [Test]
+               public override void PropertyImplementationTypes ()
+               {
+                       string code = GeneratePropertyImplementationTypes (Options);
+                       Assert.AreEqual (string.Format (CultureInfo.InvariantCulture,
+                               "public enum Test1 {{{0}" +
+                               "    {0}" +
+                               "}}{0}", NewLine), code);
+               }
+
+               [Test]
+               public override void PropertyOverloadsTest1 ()
+               {
+                       string code = GeneratePropertyOverloads1 (Options);
+                       Assert.AreEqual (string.Format (CultureInfo.InvariantCulture,
+                               "public enum Test1 {{{0}" +
+                               "    {0}" +
+                               "}}{0}", NewLine), code);
+               }
+
+               [Test]
+               public override void PropertyOverloadsTest2 ()
+               {
+                       string code = GeneratePropertyOverloads2 (Options);
+                       Assert.AreEqual (string.Format (CultureInfo.InvariantCulture,
+                               "public enum Test1 {{{0}" +
+                               "    {0}" +
+                               "    {0}" +
+                               "}}{0}", NewLine), code);
+               }
+
+               [Test]
+               public override void PropertyOverloadsTest3 ()
+               {
+                       string code = GeneratePropertyOverloads3 (Options);
+                       Assert.AreEqual (string.Format (CultureInfo.InvariantCulture,
+                               "public enum Test1 {{{0}" +
+                               "    {0}" +
+                               "    {0}" +
+                               "}}{0}", NewLine), code);
+               }
+
+               [Test]
+               public override void PropertyPrivateImplementationType ()
+               {
+                       string code = GeneratePropertyPrivateImplementationType (Options);
+                       Assert.AreEqual (string.Format (CultureInfo.InvariantCulture,
+                               "public enum Test1 {{{0}" +
+                               "    {0}" +
+                               "}}{0}", NewLine), code);
+               }
+
+               [Test]
+               public override void PropertyImplementationTypeOrder ()
+               {
+                       string code = GeneratePropertyImplementationTypeOrder (Options);
+                       Assert.AreEqual (string.Format (CultureInfo.InvariantCulture,
+                               "public enum Test1 {{{0}" +
+                               "    {0}" +
+                               "}}{0}", NewLine), code);
+               }
+
+               [Test]
+               public override void PropertyNewSlotTest ()
+               {
+                       string code = GeneratePropertyMembersType (MemberAttributes.Private |
+                               MemberAttributes.New, true, true, Options);
+                       Assert.AreEqual (string.Format (CultureInfo.InvariantCulture,
+                               "public enum Test1 {{{0}" +
+                               "    {0}" +
+                               "}}{0}", NewLine), code);
+               }
+
+               [Test]
+               public override void MethodMembersTypeTest1 ()
+               {
+                       string code = GenerateMethodMembersType1 (Options);
+                       Assert.AreEqual (string.Format (CultureInfo.InvariantCulture,
+                               "public enum Test1 {{{0}" +
+                               "    {0}" +
+                               "}}{0}", NewLine), code);
+               }
+
+               [Test]
+               public override void MethodMembersTypeTest2 ()
+               {
+                       string code = GenerateMethodMembersType2 (Options);
+                       Assert.AreEqual (string.Format (CultureInfo.InvariantCulture,
+                               "public enum Test1 {{{0}" +
+                               "    {0}" +
+                               "}}{0}", NewLine), code);
+               }
+
+               [Test]
+               public override void MethodMembersTypeTest3 ()
+               {
+                       string code = GenerateMethodMembersType3 (Options);
+                       Assert.AreEqual (string.Format (CultureInfo.InvariantCulture,
+                               "public enum Test1 {{{0}" +
+                               "    {0}" +
+                               "}}{0}", NewLine), code);
+               }
+
+               [Test]
+               public override void MethodImplementationTypes ()
+               {
+                       string code = GenerateMethodImplementationTypes (Options);
+                       Assert.AreEqual (string.Format (CultureInfo.InvariantCulture,
+                               "public enum Test1 {{{0}" +
+                               "    {0}" +
+                               "}}{0}", NewLine), code);
+               }
+
+               [Test]
+               public override void MethodOverloadsTest1 ()
+               {
+                       string code = GenerateMethodOverloads1 (Options);
+                       Assert.AreEqual (string.Format (CultureInfo.InvariantCulture,
+                               "public enum Test1 {{{0}" +
+                               "    {0}" +
+                               "}}{0}", NewLine), code);
+               }
+
+               [Test]
+               public override void MethodOverloadsTest2 ()
+               {
+                       string code = GenerateMethodOverloads2 (Options);
+                       Assert.AreEqual (string.Format (CultureInfo.InvariantCulture,
+                               "public enum Test1 {{{0}" +
+                               "    {0}" +
+                               "    {0}" +
+                               "}}{0}", NewLine), code);
+               }
+
+               [Test]
+               public override void MethodOverloadsTest3 ()
+               {
+                       string code = GenerateMethodOverloads3 (Options);
+                       Assert.AreEqual (string.Format (CultureInfo.InvariantCulture,
+                               "public enum Test1 {{{0}" +
+                               "    {0}" +
+                               "    {0}" +
+                               "}}{0}", NewLine), code);
+               }
+
+               [Test]
+               public override void MethodPrivateImplementationType ()
+               {
+                       string code = GenerateMethodPrivateImplementationType (Options);
+                       Assert.AreEqual (string.Format (CultureInfo.InvariantCulture,
+                               "public enum Test1 {{{0}" +
+                               "    {0}" +
+                               "}}{0}", NewLine), code);
+               }
+
+               [Test]
+               public override void MethodImplementationTypeOrder ()
+               {
+                       string code = GenerateMethodImplementationTypeOrder (Options);
+                       Assert.AreEqual (string.Format (CultureInfo.InvariantCulture,
+                               "public enum Test1 {{{0}" +
+                               "    {0}" +
+                               "}}{0}", NewLine), code);
+               }
+
+               [Test]
+               public override void MethodNewSlotTest ()
+               {
+                       string code = GenerateMethodNewSlot (Options);
+                       Assert.AreEqual (string.Format (CultureInfo.InvariantCulture,
+                               "public enum Test1 {{{0}" +
+                               "    {0}" +
+                               "}}{0}", NewLine), code);
+               }
+
+               [Test]
+               public override void MethodReturnTypeAttributes ()
+               {
+                       string code = GenerateMethodReturnTypeAttributes (Options);
+                       Assert.AreEqual (string.Format (CultureInfo.InvariantCulture,
+                               "public enum Test1 {{{0}" +
+                               "    {0}" +
+                               "}}{0}", NewLine), code);
+               }
+
+               [Test]
+               public override void ConstructorAttributesTest ()
+               {
+                       string code = GenerateConstructorAttributes (Options);
+                       Assert.AreEqual (string.Format (CultureInfo.InvariantCulture,
+                               "public enum Test1 {{{0}" +
+                               "    {0}" +
+                               "}}{0}", NewLine), code);
+               }
+
+               [Test]
+               public void ConstructorAttributesTest_C ()
+               {
+                       CodeGeneratorOptions options = new CodeGeneratorOptions ();
+                       options.BracingStyle = "C";
+
+                       string code = GenerateConstructorAttributes (options);
+                       Assert.AreEqual (string.Format (CultureInfo.InvariantCulture,
+                               "public enum Test1{0}" + 
+                               "{{{0}" +
+                               "    {0}" +
+                               "}}{0}", NewLine), code);
+               }
+
+               [Test]
+               public override void ConstructorParametersTest ()
+               {
+                       string code = GenerateConstructorParameters (Options);
+                       Assert.AreEqual (string.Format (CultureInfo.InvariantCulture,
+                               "public enum Test1 {{{0}" +
+                               "    {0}" +
+                               "}}{0}", NewLine), code);
+               }
+
+               [Test]
+               public override void ConstructorParameterAttributesTest ()
+               {
+                       string code = GenerateConstructorParameterAttributes (Options);
+                       Assert.AreEqual (string.Format (CultureInfo.InvariantCulture,
+                               "public enum Test1 {{{0}" +
+                               "    {0}" +
+                               "}}{0}", NewLine), code);
+               }
+
+               [Test]
+               public override void BaseConstructorSingleArg ()
+               {
+                       string code = GenerateBaseConstructor (false, Options);
+                       Assert.AreEqual (string.Format (CultureInfo.InvariantCulture,
+                               "public enum Test1 {{{0}" +
+                               "    {0}" +
+                               "}}{0}", NewLine), code);
+               }
+
+               [Test]
+               public override void BaseConstructorMultipleArgs ()
+               {
+                       string code = GenerateBaseConstructor (true, Options);
+                       Assert.AreEqual (string.Format (CultureInfo.InvariantCulture,
+                               "public enum Test1 {{{0}" +
+                               "    {0}" +
+                               "}}{0}", NewLine), code);
+               }
+
+               [Test]
+               public override void ChainedConstructorSingleArg ()
+               {
+                       string code = GenerateChainedConstructor (false, Options);
+                       Assert.AreEqual (string.Format (CultureInfo.InvariantCulture,
+                               "public enum Test1 {{{0}" +
+                               "    {0}" +
+                               "}}{0}", NewLine), code);
+               }
+
+               [Test]
+               public override void ChainedConstructorMultipleArgs ()
+               {
+                       string code = GenerateChainedConstructor (true, Options);
+                       Assert.AreEqual (string.Format (CultureInfo.InvariantCulture,
+                               "public enum Test1 {{{0}" +
+                               "    {0}" +
+                               "}}{0}", NewLine), code);
+               }
+
+               [Test]
+               public override void TypeConstructorTest ()
+               {
+                       string code = GenerateTypeConstructor (Options);
+                       Assert.AreEqual (string.Format (CultureInfo.InvariantCulture,
+                               "public enum Test1 {{{0}" +
+                               "    {0}" +
+                               "}}{0}", NewLine), code);
+               }
+
+               [Test]
+               public void TypeConstructorTest_C ()
+               {
+                       CodeGeneratorOptions options = new CodeGeneratorOptions ();
+                       options.BracingStyle = "C";
+
+                       string code = GenerateTypeConstructor (options);
+                       Assert.AreEqual (string.Format (CultureInfo.InvariantCulture,
+                               "public enum Test1{0}" + 
+                               "{{{0}" +
+                               "    {0}" +
+                               "}}{0}", NewLine), code);
+               }
+
+               [Test]
+               public override void EntryPointMethodTest ()
+               {
+                       string code = GenerateEntryPointMethod (Options);
+                       Assert.AreEqual (string.Format (CultureInfo.InvariantCulture,
+                               "public enum Test1 {{{0}" + 
+                               "    {0}" +
+#if NET_2_0
+                               "    [A()]{0}" +
+                               "    public static int Main() {{{0}" +
+#else
+                               "    public static void Main() {{{0}" +
+#endif
+                               "        Test.InnerType x;{0}" +
+                               "    }}{0}" +
+                               "}}{0}", NewLine), code);
+               }
+
+               #endregion Override implementation of CodeGeneratorFromTypeTestBase
        }
 }