We're using NUnit (2.5.9) and NMock2 for unit testing and mocking. Both, however, have a matcher syntax that closely corresponds. When I do
using NUnit.Framework;
using NMock2;
And later on the following NMock2 code:
Expect.Once.On(database).Method("Create").
With(Has.Property("id", Is.EqualTo("012345678901")));
But also an NUnit assertion:
Assert.That(someValue, Is.EqualTo(54321));
Then VS (2008) will complain that 'Is' is an ambiguous reference between 'NUnit.Framework.Is' and 'NMock2.Is' (and same for 'Has').
Is there any way around this? It seems that both matchers have similar functionality anyway. Prefixing each matcher class with the full namespace of course works, but it makes tests significantly less readable.
Google searches for this issue have found no match at all, so my underbelly feeling is that i'm doing something very stupid.