From aebedfea270dfe1ab22eac66195db6e0f37e565f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mike=20Kr=C3=BCger?= Date: Tue, 25 Sep 2012 09:56:21 +0200 Subject: [PATCH] Added test that exposes a problem with empty namespaces. --- .../CSharp/Resolver/NameLookupTests.cs | 28 +++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/ICSharpCode.NRefactory.Tests/CSharp/Resolver/NameLookupTests.cs b/ICSharpCode.NRefactory.Tests/CSharp/Resolver/NameLookupTests.cs index 4669356f58..9eda66f4ba 100644 --- a/ICSharpCode.NRefactory.Tests/CSharp/Resolver/NameLookupTests.cs +++ b/ICSharpCode.NRefactory.Tests/CSharp/Resolver/NameLookupTests.cs @@ -1065,5 +1065,33 @@ namespace foo { var method = a.Methods.Single(m => m.Name == "M"); Assert.AreEqual("A.B", method.TypeParameters.Single().DirectBaseTypes.Single().FullName); } + + [Test] + public void EmptyNamespaces() + { + // should maybe a typesystem test - but empty namespaces don't make sense in cecil. + string program = @"namespace A.B.C.D +{ + +} + +namespace Test +{ + using $A.B.C.D$; + + public class C + { + public static void Main () + { + + } + } +} + + "; + var nrr = Resolve(program); + Assert.AreEqual("A.B.C.D", nrr.NamespaceName); + } + } }