Repository navigation
Virtual Methods in C#: .NET 10, MSTest 4.5.1, Moq failure test, virtual call benchmarks - #2305
Merged
vladimir-pecanac-main merged 2 commits intoOct 24, 2026
Conversation
…al call benchmarks - Both projects net7.0 to net10.0 - Microsoft.NET.Test.Sdk 18.11.0, Moq 4.21.0, MSTest 4.5.1, coverlet.collector 10.1.0 (MSTest.TestAdapter 2.2.10 pulled Newtonsoft.Json 10.0.3, flagged NU1903) - New test: a Moq setup on the non-virtual Draw() throws NotSupportedException - Program.cs: circle area comment uses the en-US decimal point - New Benchmarks project (BenchmarkDotNet 0.15.8): non-virtual, virtual with one and two types, sealed, interface and delegate calls
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.
Sample for https://code-maze.com/virtual-methods-csharp/
WhenCircleClassDrawMock_ThenNotSupportedException: a Moq setup on the non-virtualDraw()throwsNotSupportedExceptionwith the message the article prints.Program.cs: the circle area comment now shows12.566370614359172.Benchmarksproject (BenchmarkDotNet 0.15.8) measuring non-virtual, virtual with one and two types, sealed, interface and delegate calls. Run withdotnet run -c Release --project Benchmarks.Local: SDK 10.0.302, runtime 10.0.10. Build 0 warnings, 0 errors; tests 11 of 11 passing; no vulnerable packages.