xUnit - how to check if a call does not throw an exception

If you are moving from NUnit to xUnit, you will likely encounter the absence of the DoesNotThrow method in xUnit. You are looking for something that is not there, it is not part of xUnit 2.0. I like the way that Brad Wilson describes it on github: Think of it this way: every line of code you write outside of a try block has an invisible Assert.DoesNotThrow around it. I think that is a very good explanation why this was not implemented.

I have been using xUnit for a couple of years now. I still miss the DoesNotThrow method from NUnit for one reason: explicity. Sometimes our code contains a certain path where an exception is thrown. Reading tests has to be easy, and having a DoesNotThrow in the assertion part of the tests tells us what the result should be, or not be. I think it is more explicit to write DoesNotThrow.

I am sorry I cannot give you what you were looking for, but now you know you do not need to look any further :)