Interesting sort unit test failure in VS 2008 / .NET 3.5

I have a VS 2005 solution that I just converted over to VS 2008 using the built-in Conversion Wizard.  This starts automatically when you open the VS 2005 solution in the 2008 IDE.  I run as a local Administrator and so I didn’t have any problems with the conversion.

However, a couple unit tests are failing.  One is a simple sort test to make sure that in-place sorting returns the same results when you sort on a field that has the same value across both collection items.  For example, sorting the input collection

{ “A”, “foo” }

{ “B”, “foo” }

by the second column should return the same list in the same order.  What is actually happening is that the list is reversed.  All of my CompareTo() calls in the body of my custom Sort() class return zero when I step through the code, but for some reason the framework is seeing fit to swap my items anyway.

This test worked in VS 2005 / .NET 2.0.


0 Responses to “Interesting sort unit test failure in VS 2008 / .NET 3.5”

  1. Leave a Comment

Leave a Reply

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

You are commenting using your 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

TwitterCounter for @anthonyrstevens
Add to Technorati Favorites

RSS Feed

View Anthony Stevens's profile on LinkedIn

%d bloggers like this: