Comments (2)
I might be overlooking something, but why do want to test that the result is not null? I would expect to get the same result from using Assert.Throws
directly as it fails if the method doesn't throw the expected exception.
So if myDelegate
throws TException
, then both
Assert.Throws<TException>(myDelegate);
and
Assert.That(Assert.Throws<TException>(myDelegate), Is.Not.Null);
pass successfully.
If the delegate does not throw both fail with
Expected: <TException>
But was: null
and if it is another type of exception both fail with
Expected: <TException>
But was: <AnotherException>
from nunit.
Welp, that's embarrassing. I completely confused how Assert.Throws
worked. Thanks for the quick response!
from nunit.
Related Issues (20)
- Add a test to ensure direct framework dependencies in csproj are reflected in nuspec HOT 7
- The type or namespace name 'NUnit' could not be found - when compiling with netstandard2.0 HOT 6
- System.NotSupportedException when using AsyncEnumerable test cases for `TestCaseSourceAttribute` HOT 22
- Remove ImmutableArray as a dependency of the tests HOT 5
- Benchmarks fail to run
- Is.EqualTo with empty ValueTuple throws System.NotSupportedException "Specified Tolerance not supported for instances of type 'System.ValueTuple' and 'System.ValueTuple'" after updating to NUnit 4.2.2 HOT 7
- API integrationtest logging is lost when using WebApplicationFactory (nunit 3.9) HOT 1
- Assert.ThatAsync does not support polling HOT 2
- Assert.Multiple throws 'The assertion scope was disposed out of order' when run in parallel HOT 8
- Remove `StringUtil.Compare()` and update references in the tests HOT 9
- Assert.Multiple within DelegatingTestCommand producing error: Test completed with 1 active assertion scopes HOT 4
- Best practices around testing web API controllers
- Convert `TestDelegate` and `ActualValueDelegate` to `Action` and `Func<T>`
- Invalid character in test name HOT 4
- [SetupFixture] methods not executing in expected order HOT 3
- Unable to attach ExtentReportManager as ITestListener in NUnit Test Runner HOT 1
- NET 6+8 Mac builds sometimes fail with error in "custom teardown action"
- ` [Apartment(ApartmentState.STA)]` is not respected in nunit console 3.18.2? HOT 6
- Setting thread names to make debugging easier HOT 6
- Document default parallelizability of STA tests HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from nunit.