Given the following two interfaces (these are small examples, not my actual implementation):
public interface IAssertion<T> {
IAssertion<T> IsNotNull();
IAssertion<T> Evaluate(Predicate<T> predicate)
}
public interface IStringAssertion : IAssertion<string> {
IStringAssertion IsNotNullOrEmpty();
}
and a static factory that will return the corresponding interface, for example:
public static class Require {
public static IAssertion<T> That<T>(T value) {
...
}
public static IStringAssertion That(string value) {
...
}
}
I should be able to do the following:
public void TestMethod(SomeClass a, string b) {
Require.That(a).IsNotNull();
Require.That(b).IsNotNullOrEmpty().Evaluate(SomeMethodThatAcceptsString);
}
This code compiles and will execute. I can even set up tests that pass, for example:
Assert.IsInstanceOf<IStringAssertion>(Require.That(string.Empty));
Assert.IsNotInstanceOf<IStringAssertion>(Require.That(new object());
The problem I am facing, and the whole point of this issue, is that Visual Studio 2005 intellisense does not resolve the differences between the two.
When I type Require.That("...")., I should expect to see a list
Evaluate (Predicate predicate)
IsNull ()
IsNotNullOrEmpty ()
but instead I donβt see anything.
. - Evaluate IAssertion.
, , - , , , .NET 2.0 api.
:
, Visual Studio. , Visual Studio - , . ( !)
, Visual Studio 2005, Visual Studio 2008.
:
Visual Studio 2008. , Luke. Visual Studio 2005.