MbUnit - Unit Testing on Crack September 19, '06 Comments [15] Posted in Reviews Sponsored By MbUnit is a "better xUnit" that's used by a myraid of folks I respect, including James Avery, Patrick Cauldwell and Phil Haack. It's under very active development, even though I'd once wondered aloud if it was "abandonware." It's decidedly not and it's just got a new facelift to prove it. Check out James Avery's Post called "I've seen the light and it is called MbUnitr." I've asked around and everyone has nothing but nice things to say what MbUnit brings to the table. It's NOT just NUnit with some tweaks. James says it's "Unit testing on crack." Check this out...the test will get called four times, each time with different values passed in, some intending to cause and exception and others not. Very clean and certainly nicer than making a dozen methods like "NegativeTest54". 1 [RowTest] 2 [Row("James", "myemail@email.com")] 3 [Row("James", "", ExpectedException=typeof(InvalidUserException))] 4 [Row("", "myemail@emai.com", ExpectedException = typeof(InvalidUserException))] 5 [Row("James", "mybademail.com", ExpectedException = typeof(InvalidUserException))] 6 public void AddValidUser(string name, string email) 7 { 8 User u = new User(); 9 u.Name = name; 10 u.Email = email; 11 12 u.Save(); 13 14 User newUser = User.Retrieve(u.ID); 15 Assert.IsNotNull(newUser, "User not found"); 16 Assert.IsTrue(newUser.Name == u.Name, "Name not saved correctly"); 17 Assert.IsTrue(newUser.Email == newUser.Email, "Email not saved correctly"); 18 } It's even got a feature that will rollback database changes, keeping your database fresh after each test run. Sweet. I gotta do a show on Trends in Unit Testing... « Vista Reliability and my Tolerance for P... | Blog Home | Downloading Audible Content under Vista ... » About Scott Scott Hanselman is a former professor, former Chief Architect in finance, now speaker, consultant, father, diabetic, and Microsoft employee. He is a failed stand-up comic, a cornrower, and a book author. About Newsletter Sponsored By Hosting By