Welcome to MSDN Blogs Sign in | Join | Help

Browse by Tags

All Tags » xUnit.net   (RSS)
One step past Assert.Throws<>
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...
ReSharper and xUnit.net
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...
Weaving with xUnit.net
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...
Faking out [PrincipalPermission]
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...
xUnit.net goes live!
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...
Page view tracker