I have a OneTimeSetup where I want to verify integration connections prior to running tests (databases, REST endpoints, etc.), short-circuiting the suite if there is an issue. Consider something like
Try
Dim testContext As DBContext = New DBContext(_configuredConnectionString)
VerifySQLConnection(testContext)
Catch ex As Exception
Dim actionableError As String = String.Format(_VERIFY_SQL_CONNECTION_TEMPLATE, _configuredConnectionString)
Dim actionableException As New ConfigurationException(actionableError, ex)
'Throw actionableException
Assert.Inconclusive(actionableError)
End Try
If a connection fails, I don't want to fail the test, I want to assert that the entire suite is inconclusive, because the actual test never ran.
I'm noticing that Assert.Inconclusive lacks an overload taking in an inner exception. This forces me to either fail all tests, with a full inner exception to inspect, or mark tests as inconclusive, but lose actionable information from an NUnit test runner window.
- Is there a reason for this or is this overload missing an oversight?
- Is there an alternative I could use to get both Inconclusive and the full inner exception (not just the message, but stack, etc.)?