public void ImportInNestedNamespace(string atGlobal, string inNamespace, string inNestedNamespace, Type type) { var csharp = new CSharpHelper(); Assert.Equal(atGlobal, csharp.NameOf(type)); using (csharp.BeginNamespaceDeclaration("Fsi")) { csharp.Import("System"); Assert.Equal(inNamespace, csharp.NameOf(type)); using (csharp.BeginNamespaceDeclaration("TextTemplating")) { csharp.Import("System.Threading"); Assert.Equal(inNestedNamespace, csharp.NameOf(type)); } } Assert.Equal(atGlobal, csharp.NameOf(type)); using (csharp.BeginNamespaceDeclaration("Fsi")) { csharp.Import("System"); Assert.Equal(inNamespace, csharp.NameOf(type)); using (csharp.BeginNamespaceDeclaration("TextTemplating")) { csharp.Import("System.Threading"); Assert.Equal(inNestedNamespace, csharp.NameOf(type)); } } }
public void ImportAtGlobal(string expected, Type type) { var csharp = new CSharpHelper(); csharp.Import("System"); csharp.Import("System.Threading"); Assert.Equal(expected, csharp.NameOf(type)); }
protected void TypeOfNameOf(string expected, Type type) { var csharp = new CSharpHelper(); csharp.Import("System"); csharp.Import("System.Threading"); Assert.Equal(expected, csharp.TypeOfNameOf(type)); Assert.Equal(expected, csharp.TypeOfNameOf(type)); }
protected void AppendTypeOfNameTo(string expected, Type type) { var csharp = new CSharpHelper(); csharp.Import("System"); csharp.Import("System.Threading"); var typeName = new StringBuilder(type.Name.Length); csharp.AppendTypeOfNameTo(type, typeName); Assert.Equal(expected, typeName.ToString()); typeName.Clear(); csharp.AppendTypeOfNameTo(type, typeName); Assert.Equal(expected, typeName.ToString()); }
public void CRefNameOfWithoutSystemNamespace(string expected, Type type) { var csharp = new CSharpHelper(); csharp.Import("System.Threading"); Assert.Equal(expected, csharp.CRefNameOf(type)); Assert.Equal(expected, csharp.CRefNameOf(type)); }