Copilot instructions
.github/instructions/tests.instructions.mdCopilot instructions
Quality
63/100
Scores the file, not the repository.Length
348 words
8 headings · 0 code blocksRepository
7
— · pushed 172 days agoLast changed
3 days ago
First indexed 3 days ago.12345# General Guidelines6- Use these frameworks: xUnit, Moq, FluentAssertions (existing tests), xUnit Asserts (new tests).7- For unit tests on Repository classes, use Squadron to create a MongoDB.8- If there are more than 5 asserts to do on a result, use Snapshooter instead.9- Use Theories instead of multiple tests.10- Never use [MemberData].1112# Test Naming Conventions13- Test class names should end with "Tests" (e.g., UserServiceTests)14- Test method names should follow the pattern: MethodName_Scenario_ExpectedBehavior15- Use descriptive names that clearly indicate what is being tested16- Name the result in the Act part either `result` or `act` when testing for exceptions.1718# Test Data and Setup19- Mocks:20 Define as fields and instantiate directly if possible21 Pre-configure default behaviour in the constructor when appropriate22 Use MockBehavior.Strict as default23- Instantiate the class under test in the constructor of the test class24- Avoid creating the same test data repeatedly. Instead, use sample data classes.25- When using Squadron, ensure to re-use the instance by creating a collection fixture2627# Test Structure28- Follow Arrange-Act-Assert (AAA) pattern in all tests29- Use separate lines or comments to clearly delineate AAA sections30- Keep tests focused on a single behavior or scenario31- Having no or few lines in the Arrange section is preferred.3233# Assertions34- Use FluentAssertions for consistency reasons for existing tests35- Use xUnit Asserts in new tests3637# Snapshot Testing38- Use Snapshooter when testing complex objects with many properties39- Update snapshots deliberately when behavior changes are intended40- Review snapshot changes carefully during code reviews4142# Mocking and Dependencies43- Use clear, descriptive variable names for mocks44- Avoid defining mocks inside the test method when possible.45- Verify mock interactions when behavior verification is important46- When verifying mock interactions, avoid using It.IsAny<T>() if a more specific constraint can be used4748# Error Handling and Exception Testing49- Test both happy path and error scenarios50- Use FluentAssertions for exception testing: .Should().ThrowExactly[Async]<ExceptionType>()51- Verify exception messages and properties when relevant52- Test error propagation in service layers53
Also in AndreasKarz/Vibe-Coding-Dev-Setup
Diff this repo’s formatsOne repository carrying more than one format is the comparison this product exists for: does anyone actually write different content in each file, or is one a copy of the other?
| Repository | Format | Stack | Covers | Score | Changed |
|---|---|---|---|---|---|
| AndreasKarz/Vibe-Coding-Dev-Setup.github/AGENTS.md · 7 | AGENTS.md | stylegitagent-behaviour | 66/100 | 3 days ago | |
| AndreasKarz/Vibe-Coding-Dev-Setup.github/instructions/general.instructions.md · 7 | Copilot instructions | stylearchapido-not | 77/100 | 3 days ago | |
| AndreasKarz/Vibe-Coding-Dev-Setup.github/instructions/graphql.instructions.md · 7 | Copilot instructions | typesapido-not | 57/100 | 3 days ago | |
| AndreasKarz/Vibe-Coding-Dev-Setup.github/instructions/worker.instructions.md · 7 | Copilot instructions | dependenciesdo-not | 51/100 | 3 days ago |
Similar configs
Same format, overlapping stack, ranked by quality.
| Repository | Format | Stack | Covers | Score | Changed |
|---|---|---|---|---|---|
| chihebnabil/lovable-boilerplate.github/instructions/global.instructions.md · 63 | Copilot instructions | buildlint-formatstylearch+4 | 100/100 | 3 days ago | |
| louislam/uptime-kuma.github/copilot-instructions.md · 90k | Copilot instructions | setupbuildtestlint-format+9 | 100/100 | 3 days ago | |
| HerringtonDarkholme/megarepo.github/copilot-instructions.md · 17 | Copilot instructions | setupbuildtestlint-format+7 | 100/100 | 3 days ago | |
| dotnet/roslyn.github/instructions/Compiler.instructions.md · 21k | Copilot instructions | buildteststylearch+3 | 99/100 | 3 days ago | |
| JCodesMore/ai-website-cloner-template.github/copilot-instructions.md · 31k | Copilot instructions | buildlint-formatstylearch+3 | 97/100 | 2 days ago | |
| dotnet/roslyn.github/copilot-instructions.md · 21k | Copilot instructions | buildteststylearch+3 | 97/100 | 3 days ago | |
| bagisto/bagisto.github/copilot-instructions.md · 28k | Copilot instructions | setupbuildteststyle+5 | 97/100 | 3 days ago | |
| darkmatter/nixmac.github/copilot-instructions.md · 24 | Copilot instructions | setupbuildtestlint-format+8 | 96/100 | 3 days ago |
