Remove Shouldly from ProjectCachePlugin sample#13219
Open
Conversation
Contributor
|
Hello @@copilot, I noticed that you’re changing an .swr file or any file under src/Package/MSBuild.VSSetup.. Please make sure to validate this change by an experimental VS insertion. This is accomplished by pushing to an exp/* branch, which requires write permissions to this repo. |
Merged
…n sample and remove Shouldly package reference Co-authored-by: rainersigwald <3347530+rainersigwald@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Remove Shouldly reference and replace assertions
Remove Shouldly from ProjectCachePlugin sample
Feb 6, 2026
rainersigwald
approved these changes
Feb 6, 2026
Contributor
There was a problem hiding this comment.
Pull request overview
This PR removes the Shouldly assertion library from the ProjectCachePlugin sample by replacing its only usage (a null-check on buildRequest.ProjectInstance) with a standard runtime guard and by dropping the Shouldly PackageReference.
Changes:
- Replaced
ShouldNotBeNull(...)with an explicitis nullcheck that throwsInvalidOperationException - Removed
using Shouldly;from the sample implementation - Removed the
ShouldlyPackageReference from the sample project file
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| src/Samples/ProjectCachePlugin/ProjectCachePlugin.csproj | Removes the unused Shouldly dependency from the sample project. |
| src/Samples/ProjectCachePlugin/AssemblyMockCache.cs | Replaces the Shouldly assertion with a standard null-check + exception. |
SimaTian
approved these changes
Feb 13, 2026
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.
Context
The
ProjectCachePluginsample uses Shouldly (a test assertion library) in production code solely to null-checkbuildRequest.ProjectInstance. This is an unnecessary dependency for a simple precondition check.Changes Made
ShouldNotBeNull()with a plainis nullcheck throwingInvalidOperationExceptionusing Shouldly;and theShouldlyPackageReference from the projectTesting
Build succeeds with 0 warnings, 0 errors. Behavior is identical — null
ProjectInstancestill throws with the same message.Notes
Original prompt
✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.