The hack basically involves using some compile tests to switch between NUnit and VS2005 native testing.
The code he cites was actually found in the Patterns & Practices group Composite UI block source and is remarkably simple, requiring just the following code at the head of every test class and a change from using [Test]attributes to using [TestMethod]attributes instead.
#if !NUNITNice when you find a simple solution to an apparently intractable problem!
using Microsoft.VisualStudio.TestTools.UnitTesting;
#else
using NUnit.Framework;
using TestClass = NUnit.Framework.TestFixtureAttribute;
using TestMethod = NUnit.Framework.TestAttribute;
using TestInitialize = NUnit.Framework.SetUpAttribute;
using TestCleanup = NUnit.Framework.TearDownAttribute;
#endif
No comments:
Post a Comment