[Mono-dev] Can we change the name of the MonoTests.System namespace?

Dean Brettle dean at brettle.com
Wed Jan 9 04:53:38 EST 2008

Hi all,

This has happened several times now.  I'm adding some code to a unit
test class and want to use the fully qualified name (e.g.
System.Web.UI.Adapters.PageAdapter) for some type, either because (a)
I'm only using the type in a couple spots and I'd rather not pollute
the namespace with a 'using' declaration, or (b) the unqualified name
(e.g. PageAdapter) is already being used in the current namespace for
something else.

But when I try to use the fully qualified name I get a compile time
error like this:

error CS0234: The type or namespace name `PageAdapter' does not exist
in the namespace `MonoTests.System.Web.UI.Adapters'. Are you missing
an assembly reference?

Basically, the compiler uses (correctly I think) the System namespace
under MonoTests instead of the top-level System namespace.

I could do:

using Sys = System;

but that is going to make my code less readable.  The next developer
to come along will have to check the using declarations to figure out
exactly what Sys.Web.UI.Adapters.PageAdapter refers to.

As I mentioned above, I could do:

using System.Web.UI.Adapters;

but that will unnecessarily pollute the namespace when I'm only using
the type in a couple spots.  It also doesn't help when the name is
already in use in the current namespace.

This wouldn't be a problem if we didn't have a namespace named
"System" under MonoTests.  Thus the question in the subject of this

Can we change the name of the MonoTests.System namespace?

We could use MonoTests_System, MonoTestsSystem, or perhaps just
System.  Using just System has the advantage that we wouldn't need as
many using declarations to access the classes being tested, but there
might be some major disadvantage that I'm missing.



More information about the Mono-devel-list mailing list