Browse by Tags
All Tags »
xUnit.net (RSS)
If you’re not using xUnit (and you should be), at least consider adopting the practices they have for dealing with exceptions in unit tests. From the very first release, they moved us from this: [ExpectedException(typeof(InvalidOperationException))] public
Read More...
Those of you who have switched over to xUnit.Net may have a received a nasty surprise with the 'type members layout' feature of ReSharper: it doesn't respect method attributes. Namely, you can tell it to not reorder methods in an NUnit fixture like this:
Read More...
There has been mixed reaction to the removal of [SetUp] and [TearDown] in xUnit.net. Personally, I think it's great as it helps to raise unit test 'smells', particularly around how classes interact with each another. Here's a small example of how we can
Read More...
Depending on how your unit tests are setup, you may not be running as the proper user and won't have the necessary permissions to invoke a method. If this happens, you can easily alter the principle thread's identity with the following code. For instance,
Read More...
NUnit is dead! Long live xUnit.net! There are several cool features, including aspect-like extensibility for tests, but the two changes that will immediately make a difference in my day-to-day coding are: [ExpectedException] is gone. In its place is Assert.Throws<T>(
Read More...