public void TestNamespaceImportsCS() { string[] expected = { "namespace N1", "{", " using N1.N2;", " using N1.N2.N3.N4;", " using System;", "", " public class TestClass", " {", " public void Method()", " {", " new A();", " new N2.N3.B();", " new C();", " Console.WriteLine();", " new CodeDomExtTests.TestClasses.BaseClass();", " new @namespace.@object.@class();", //N1.namespace.object.class " }", " }", "}" }; ProviderTestUtils.DoCSharpTest(expected, ReadabilityImprovementsTestUtils.TestTypeWithImport(), new GeneratorOptions() { DoConsistencyChecks = false, AlwaysUseFullyQualifiedName = false }); }
public void TestNamespaceImportsVB() { string[] expected = { "Imports N1.N2", "Imports N1.N2.N3.N4", "Imports System", "", "Namespace N1", " Public Class TestClass", " Public Sub Method()", " New A()", " New N2.N3.B()", " New C()", " Console.WriteLine()", " New CodeDomExtTests.TestClasses.BaseClass()", " New [namespace].object.class()", " End Sub", " End Class", "End Namespace" }; ProviderTestUtils.DoVisualBasicTest(expected, ReadabilityImprovementsTestUtils.TestTypeWithImport(), new GeneratorOptions() { DoConsistencyChecks = false, AlwaysUseFullyQualifiedName = false }); }