Sync with TemplateDotNetLibrary template updates#114
Conversation
Co-authored-by: Malcolmnixon <1863707+Malcolmnixon@users.noreply.github.com>
|
@copilot Got the following problem: Please analyze the change you did and see if it's appropriate. |
Co-authored-by: Malcolmnixon <1863707+Malcolmnixon@users.noreply.github.com>
The issue was that importing Fixed in a6171c7 by dropping the |
|
@copilot Now that the Polyfills library is present, are there any language features that should be used that were perhaps avoided due to older language versions or missing runtime functionality? |
There was a problem hiding this comment.
Pull request overview
Syncs this repository with upstream TemplateDotNetLibrary updates to reduce drift, covering CI workflow enhancements, project configuration changes, and tooling/documentation additions.
Changes:
- Expands CI build matrix to include macOS, simplifies OS job ID generation, and configures CodeQL to use manual build mode.
- Updates project files to add Polyfill configuration and expose internals to the test assembly.
- Refreshes agent/docs assets and adds a GitHub “Question/Help” issue form.
Reviewed changes
Copilot reviewed 7 out of 7 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| test/DemaConsulting.TestResults.Tests/DemaConsulting.TestResults.Tests.csproj | Adds an implicit global using for Polyfills in the test project. |
| test/DemaConsulting.TestResults.Tests/AssemblyInfo.cs | Adds InternalsVisibleTo for DynamicProxy to support proxy-based mocking scenarios. |
| src/DemaConsulting.TestResults/DemaConsulting.TestResults.csproj | Adds Polyfill configuration and InternalsVisibleTo for the test project. |
| AGENTS.md | Rewrites agent guidance into a concise quick-reference format. |
| .github/workflows/build.yaml | Adds macOS to the build matrix, simplifies OS short-name logic, and sets CodeQL build-mode: manual. |
| .github/agents/test-developer.md | Adds an MSTest best-practice note encouraging Assert.StartsWith. |
| .github/ISSUE_TEMPLATE/question.yml | Adds a “Question / Help” GitHub issue form template. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
You can also share your feedback on Copilot code review. Take the survey.
test/DemaConsulting.TestResults.Tests/DemaConsulting.TestResults.Tests.csproj
Show resolved
Hide resolved
Co-authored-by: Malcolmnixon <1863707+Malcolmnixon@users.noreply.github.com>
Yes — two argument validation patterns could be improved now that
One subtlety: |
Pull Request
Description
Pulls in updates from the TemplateDotNetLibrary template to reduce drift.
Workflow (
build.yaml)macos-latestto the build matrixOS_SHORTsed pattern tos/-latest//(handles any OS automatically)build-mode: manualto CodeQL init stepSource project (
DemaConsulting.TestResults.csproj)Polyfillv9.13.0 (PrivateAssets="All") and<PolyArgumentExceptions>true</PolyArgumentExceptions><InternalsVisibleTo Include="DemaConsulting.TestResults.Tests" />Test project
<Using Include="Polyfills" />implicit using (forward-looking; also ensures tests onnet481can use polyfill helpers directly if needed)[assembly: System.Runtime.CompilerServices.InternalsVisibleTo("DynamicProxyGenAssembly2")]toAssemblyInfo.csusing a fully-qualified attribute name to avoid anExecutionScopeambiguity withMicrosoft.VisualStudio.TestTools.UnitTestingonnet481Serializer improvements (enabled by Polyfill)
_ = results ?? throw new ArgumentNullException(nameof(results))withArgumentNullException.ThrowIfNull(results)inJUnitSerializer.SerializeandTrxSerializer.Serializeif (string.IsNullOrWhiteSpace(...)) { throw ... }withArgumentException.ThrowIfNullOrWhiteSpace(...)inJUnitSerializer.Deserialize,TrxSerializer.Deserialize, andSerializer.Deserialize<exception>comments to separately documentArgumentNullException(null) andArgumentException(whitespace) casesThrowsExactly<ArgumentException>toThrowsExactly<ArgumentNullException>to match the corrected exception type (ThrowIfNullOrWhiteSpacethrowsArgumentNullExceptionfor null)Tooling / docs
.github/ISSUE_TEMPLATE/question.ymlAssert.StartsWith) totest-developer.mdAGENTS.mdto the new concise quick-reference formatType of Change
Related Issues
Pre-Submission Checklist
Before submitting this pull request, ensure you have completed the following:
Build and Test
dotnet build --configuration Releasedotnet test --configuration ReleaseCode Quality
dotnet format --verify-no-changesQuality Checks
Please run the following checks before submitting:
cspell "**/*.{md,cs}"markdownlint "**/*.md"yamllint .Testing
Documentation
Additional Notes
The
Polyfillpackage isPrivateAssets="All"— it does not become a transitive dependency of library consumers.On
net481,ExecutionScopeexists in bothSystem.Runtime.CompilerServicesandMicrosoft.VisualStudio.TestTools.UnitTesting. Using a fully-qualifiedSystem.Runtime.CompilerServices.InternalsVisibleToattribute (rather than ausingimport) avoids the ambiguity without affecting other target frameworks.ArgumentException.ThrowIfNullOrWhiteSpacethrowsArgumentNullExceptionfornullinputs andArgumentExceptionfor empty/whitespace inputs. Null-input Deserialize tests were updated accordingly to expectArgumentNullExceptionrather thanArgumentException.The
<Using Include="Polyfills" />in the test project does not cause build errors or warnings (verified withTreatWarningsAsErrors=trueandEnforceCodeStyleInBuild=true). On .NET 8/9/10 thePolyfillsnamespace has no additional types (those APIs are native to the BCL), so the import is silently a no-op while remaining available for future use onnet481.💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.