Skip to content

UsingStaticInCSharp: move to .NET 10 and test real output - #2354

Open
vladimir-pecanac-main wants to merge 1 commit into
CodeMazeBlog:mainfrom
vladimir-pecanac-main:seo/76037-using-static-feature-csharp
Open

vladimir-pecanac-main wants to merge 1 commit into
CodeMazeBlog:mainfrom
vladimir-pecanac-main:seo/76037-using-static-feature-csharp

Conversation

@vladimir-pecanac-main

Copy link
Copy Markdown
Collaborator

Moves the UsingStaticInCSharp sample to net10.0 with xunit 2.9.3, xunit.runner.visualstudio 4.0.1, Microsoft.NET.Test.Sdk 18.11.0 and coverlet.collector 10.1.0, and removes Moq. The six old tests mocked each Caller and verified that Invoke() was called, so they never ran the code under test; they are replaced by ten tests that run the real callers and assert on their console output. The nested type example now has MethodA() and MethodB() and a second caller that imports the outer class, matching the article. New GlobalUsingStatic and MemberPrecedence folders hold the global using static example (with the commented CS0121 call) and the case where a class's own member wins over an imported one. Also fixes the 'contants' typo in the Constants output.

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.

1 participant