XUnit.NET aims to be the Next NUnit, but it's too soon

My blog has moved. You can view this post at the following address: http://www.osherove.com/blog/2007/9/21/xunitnet-aims-to-be-the-next-nunit-but-its-too-soon.html
Published Friday, September 21, 2007 7:48 PM by RoyOsherove

Comments

Friday, September 21, 2007 11:39 PM by Scott Bellware [MVP]

# SetUp and Teardown Methods in Test Classes

Jim Newkirk is blogging about the down side of setup and teardown methods in test classes, and why you

Saturday, September 22, 2007 12:17 AM by Fear and Loathing

# The World Doesn't Need Yet Another .NET Testing Framework

I have a lot of respect for Jim Newkirk but I was reading Roy Osheroves blog entry about the new XUnit

Saturday, September 22, 2007 2:03 AM by Brad Wilson

# re: XUnit.NET aims to be the Next NUnit, but it's too soon

Hey Roy, thanks for the comments. :) A common theme we were shooting for is simplicity. Here are some answers to your questions:

We did not forget Fail. We attempted to simplify a lot of things in the system. I personally believe that the need to use Fail() means there is probably a missing Assert, so rather than encouraging people to use Fail, I'd like to know what assert is actually missing.

I believe mocking frameworks are best left outside the unit testing framework. Everybody has their feelings on which they like best. Personally I usually hand-write stubs, but of all the ones I've used, I like Rhino best.

"Equals" is a static method on Object. We explicitly override it and mark it obsolete because its name is so close to "Equal", but it's not the same thing.

Generics can be implicitly instantiated. Assert.Equal("foo", "bar") works just fine, since the compiler knows that both are strings and automatically calls Assert.Equal<string> on your behalf.

For a while, we did have BeforeEachTest() and AfterEachTest() as part of ITestFixture, but we felt that leveraging the language as much as possible made more sense. Since we create a new instance of the test object for each test run, you can use the constructor and IDisposable.Dispose() in place of SetUp and TearDown.

We're going to devote a separate article soon to the process of migrating from NUnit, including the usage of our [RunWithNUnit] sample attribute in xunit.extensions.dll.

Thanks again!

Saturday, September 22, 2007 2:34 AM by Brad Wilson - The .NET Guy

# Answering xUnit.net Questions

Saturday, September 22, 2007 11:11 AM by Andrew Stopford's Weblog

# xUnit.net, one more to the mix.

I was away on vacation this week and when ever I go away the week is eventful, I came back to the news

Saturday, September 22, 2007 12:10 PM by ISerializable - Roy Osherove's Blog

# MbUnit vs. NUnit Vs. Team System Unit Testing - Choosing a unit test framework

Update : There's a new Unit test framework called XUnit.NET. More info here. MbUnit is gaining some momentum

Tuesday, September 25, 2007 9:04 PM by Scott Hanselman's Computer Zen

# The Weekly Source Code 6

Tuesday, September 25, 2007 9:31 PM by Scott Hanselman's Computer Zen

# The Weekly Source Code 6

Friday, September 28, 2007 8:18 AM by Adam Goucher » Blog Archive » Introducing xUnit.NET

# Adam Goucher &raquo; Blog Archive &raquo; Introducing xUnit.NET

Pingback from  Adam Goucher  &raquo; Blog Archive   &raquo; Introducing xUnit.NET

Monday, October 01, 2007 5:44 AM by Paul Kohler

# re: XUnit.NET aims to be the Next NUnit, but it's too soon

Why not just add to NUnit? One of the main things I miss from NUnit compared to MBUnit for example is the RowTest attribute... but I would rather make a slight compromise in my test style and call methods from within my test than embark on a new framework!

I did put some effort into a "one line unit test" type framework last year but in practice then I was just using 2 frameworks. Unless theres a huge need I think it better to stick to the mainstream... my 2 cents ;-)

Wednesday, October 03, 2007 1:16 AM by Richard W

# re: XUnit.NET aims to be the Next NUnit, but it's too soon

I love the reduced syntax for xUnit.net. I definately feel that NUnit suffers from bloating tests with more syntax than is required. For example, I often do not require setting up or tearing down tests. If I do why do I need an attribute to do it, when the test framework can just use the constructor instead. Often I do not require most of the feature set that NUnit offers. NUnit is unnessasarily harder to learn than xUnit.net. Often I only want a simple test method. xUnit is a better testing framework to support.

Monday, October 08, 2007 4:10 PM by ASPInsiders

# The Weekly Source Code 6

In my new ongoing quest to read source code to be a better developer , I now present the sixth in an

Monday, October 08, 2007 4:11 PM by Scott Hanselman's Computer Zen - The Weekly Source Code 6

# Scott Hanselman's Computer Zen - The Weekly Source Code 6

Pingback from  Scott Hanselman's Computer Zen - The Weekly Source Code 6

Monday, October 08, 2007 6:29 PM by Chandra

# re: XUnit.NET aims to be the Next NUnit, but it's too soon

I think from a user point of view, use the one suits best in the situation you are testing.

I would still wait for xUnit.NET to mature because when I need some help, I can find a lot of information about nUnit then on xUnit.

Wednesday, January 14, 2009 7:23 AM by Confluence: SharePoint Development Wiki

# SharePoint Development with Unit Testing

"unit testing is a method of testing that verifies the individual units of source code are working properly. A unit is the smallest testable part of an application. In procedural programming a unit may be an individual program, function, procedure,..

Wednesday, January 14, 2009 7:29 AM by Confluence: SharePoint Development Wiki

# Comparisons of Unit Test Frameworks for SharePoint Development

Pros Cons nUnit

Friday, January 01, 2010 11:23 PM by Confluence: SharePoint Implementation Play book

# Comparisons of Unit Test Frameworks for SharePoint Development

Pros Cons nUnit