XUnit: NotEqual messes parameter order

I”ve been using XUnit in my last project and I must say that I”m pretty excited with it. Besides letting me throw in the “correct place” (ie, no more ExpectedExceptionAttribute!), I”m really enjoying its simplicity. Unfortunately, there are still some bugs that need to be solved. Today I”ve just tripped on what I think is a bug: NotEqual messes the parameter order.

If you go through the docs, you”ll see that it supports the NotEqual supports the following overloads:

NotEqual<T>(T, T)
NotEqual<T>(T, T, IComparer<T>)
NotEqual<T>(T, T, String)
NotEqual<T>(T, T, IComparer<T>,String)

The blame lies on the version that is bolder:

public static void NotEqual<T>(T expected,T actual, IComparer<T> comparer)
    NotEqual<T>(actual, expected, comparer, null);

As you can see, the method is changing the order of the parameters and this is messing all mye NotEqual tests where I”m not passing a comparer and a string! Lets hope it gets fixed before the next version is released.


~ by Luis Abreu on January 3, 2008.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s

%d bloggers like this: