Skip to content

MockingWithNSubstitute: retarget net10.0, NSubstitute 6.2.0 - #2085

Merged
CodeMazeBlog merged 1 commit into
CodeMazeBlog:mainfrom
vladimir-pecanac-main:seo/94674-nsubstitute
Aug 12, 2026
Merged

MockingWithNSubstitute: retarget net10.0, NSubstitute 6.2.0#2085
CodeMazeBlog merged 1 commit into
CodeMazeBlog:mainfrom
vladimir-pecanac-main:seo/94674-nsubstitute

Conversation

@vladimir-pecanac-main

Copy link
Copy Markdown
Collaborator

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.

…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.
@CodeMazeBlog
CodeMazeBlog merged commit eca0672 into CodeMazeBlog:main Aug 12, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants