19. May 2005 09:33
It's been a while since I started porting my venerable learning project XmlView.NET (an XML viewer that includes XSD schema validation) to .NET 2.0 Beta 2. The original .NET 1.1 project uses NUnit to the test the application's core (or model, if you will), so I was anxious to see how VSST's unit testing facilities stack up against NUnit and VS .NET 2003:
- First, it's very annoying that MS introduced a new API that does not follow the classic xUnit approach. Instead of TestFixture, we now have TestClass. Instead of SetUp and TearDown, we now have TestInitialize and TestCleanup. You can get around this by using alias directives, but this is just a kludge.
- The current performance is rather poor. This is already one of the top bugs in the MSDN product feedback center.
- If you've ever seen any xUnit test runner, you know what the green bar is. There's no green bar in VS 2005. It puts green checkmarks next to each test that has run successfully. I prefer having a green bar, as it is a much more obvious indicator than simple check marks.
- Microsoft.VisualStudio.QualityTools.UnitTesting.Framework.Assert offers generics support, e.g. Assert.AreEqual<T>—neat.
- The ClassInitialize (think TestFixtureSetUp), ClassCleanup (think TestFixtureTearDown), AssemblyInitialize (that's new), and AssemblyCleanup (new as well) attributes don't work as advertised and are not properly documented—typical beta woes.