+
+ [Test]
+ public void EscapePropertyName ()
+ {
+ CodeNamespace cns = new CodeNamespace ();
+ CodeTypeDeclaration ctd = new CodeTypeDeclaration ("TestType");
+ CodeMemberProperty f = new CodeMemberProperty ();
+ f.Type = new CodeTypeReference (typeof (string));
+ f.Name = "default";
+ f.GetStatements.Add (new CodeMethodReturnStatement (
+ new CodePrimitiveExpression (null)));
+ ctd.Members.Add (f);
+ cns.Types.Add (ctd);
+ CSharpCodeProvider p = new CSharpCodeProvider ();
+ StringWriter sw = new StringWriter ();
+ p.CreateGenerator ().GenerateCodeFromNamespace (cns, sw, null);
+ Assert.IsTrue (sw.ToString ().IndexOf ("@default") > 0);
+ }
+
+ [Test]
+ public void GenericCodeTypeReferencesTest ()
+ {
+ string code = GenerateGenericCodeTypeReferences (Options);
+ Assert.AreEqual (string.Format (CultureInfo.InvariantCulture,
+ "public class Test {{{0}" +
+ " {0}" +
+ " private System.Nullable<int> Foo;{0}" +
+ " {0}" +
+ " private System.Nullable<> Bar;{0}" +
+ "}}{0}", NewLine), code);
+ }
+
+ [Test]
+ public override void PartialTypeTest ()
+ {
+ string code = GeneratePartialType (Options);
+ Assert.AreEqual (string.Format (CultureInfo.InvariantCulture,
+ "public partial class Test1 {{{0}" +
+ "}}{0}", NewLine), code);
+ }