MockingWithNSubstitute: retarget net10.0, NSubstitute 6.2.0 - #2085
Merged
CodeMazeBlog merged 1 commit intoAug 12, 2026
Merged
Conversation
…ExceptionExtensions Bumped to NSubstitute 6.2.0 and xUnit 2.9.3 on net10.0. Replaced FluentAssertions with plain xUnit asserts so the sample carries no extra assertion dependency; FluentAssertions 8 moved to the Xceed Community License and the article is about mocking, not assertions. Switched the exception test from the When().Do() lambda-throw workaround to NSubstitute.ExceptionExtensions Throws<T>(), and added a ThrowsAsync<T>() example on a new asynchronous IEmailService member. Removed the no-op try/catch wrapper from NotifyUser and renamed the exception test to say what it actually asserts.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Retargets to net10.0, bumps NSubstitute to 6.2.0 (BSD-3-Clause). Removes a no-op catch { throw; } block and drops FluentAssertions for plain xUnit asserts per house code-minimalism rule. 4/4 tests pass on net10.0.