Asserts
Assertions
xUnit.net | Comments |
| MSTest and xUnit.net support generic versions of this method |
| MSTest and xUnit.net support generic versions of this method |
| |
| |
| |
| |
| Ensures that a value is in a given inclusive range |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| Ensures that a value is not in a given inclusive range |
| Ensures that the code throws an exact exception |
Older versions of xUnit.net provided an Assert.DoesNotThrow which was later removed. It revealed itself to be an anti-pattern of sorts; every line of code is itself an implicit “does not throw” check, since any thrown exceptions would cause the test to fail. Simply “not throwing” is not generally a sufficient validation, so it would be expected that additional assertions would exist.
Last updated