.NET Testing Basic Skills Overview
🤖 AI Agent Important Note
When you (AI Agent) are loaded into this entry skill, please read the following guidelines first:
📋 Positioning of This Skill
This document is a "Navigation Hub" designed to help find the correct sub-skills.
Your Tasks Are
- ✅ Match corresponding sub-skills based on user needs
- ✅ Use the tool to load specific sub-skills
- ✅ Let the sub-skills provide professional testing guidance
Prohibited Actions
- ❌ Do not directly provide test code in this entry skill
- ❌ Do not start implementing tests without loading sub-skills
- ❌ Do not skip sub-skills to provide "general" testing recommendations
🎯 Quick Skill Reference Table (Must-Read for AI Agents)
Keywords mentioned by users → Sub-skills to load
Most Frequently Used Skills (Must Memorize)
| User says... | Load Command | Purpose |
|---|
| Validator, validator, CreateUserValidator | /skill dotnet-testing-fluentvalidation-testing
| FluentValidation Testing |
| Mock, mocking, IRepository, IService | /skill dotnet-testing-nsubstitute-mocking
| Mock external dependencies |
| AutoFixture, test data generation | /skill dotnet-testing-autofixture-basics
| Automatically generate test data |
| Assertion, Should(), BeEquivalentTo | /skill dotnet-testing-awesome-assertions-guide
| Fluent Assertions (Essential to Learn) |
| DateTime, time testing, TimeProvider | /skill dotnet-testing-datetime-testing-timeprovider
| Time-related testing |
| File, file system, IFileSystem | /skill dotnet-testing-filesystem-testing-abstractions
| File system testing |
| Bogus, fake data, Faker | /skill dotnet-testing-bogus-fake-data
| Realistic fake data generation |
| Builder Pattern, WithXxx | /skill dotnet-testing-test-data-builder-pattern
| Test Data Builder |
| Deep comparison, DTO comparison, Excluding | /skill dotnet-testing-complex-object-comparison
| Complex object comparison |
Basic Entry-Level Skills
| User says... | Load Command | Purpose |
|---|
| Start from scratch, testing fundamentals, FIRST principles | /skill dotnet-testing-unit-test-fundamentals
| Unit testing fundamentals |
| Test naming, how to name tests | /skill dotnet-testing-test-naming-conventions
| Naming conventions |
| Create test project, xUnit setup | /skill dotnet-testing-xunit-project-setup
| Project setup |
Advanced Skill Combinations
| User says... | Load Command | Purpose |
|---|
| AutoFixture + Bogus | /skill dotnet-testing-autofixture-bogus-integration
| Automation + realistic data |
| AutoFixture + NSubstitute | /skill dotnet-testing-autofixture-nsubstitute-integration
| Automatically create Mocks |
| AutoData, Theory testing | /skill dotnet-testing-autodata-xunit-integration
| Parameterized testing |
| Test output, ITestOutputHelper | /skill dotnet-testing-test-output-logging
| Test logging |
| Coverage, Coverlet | /skill dotnet-testing-code-coverage-analysis
| Code coverage analysis |
⚠️ Usage Flow Examples
✅ Correct Flow
User: Please help me create tests for CreateUserValidator
AI: I notice you need to test Validators. According to the quick reference table,
I should load the dotnet-testing-fluentvalidation-testing skill.
[Use Skill tool to load sub-skill]
AI: Now I will create tests for you following the guidelines from the FluentValidation Testing skill...
❌ Incorrect Flow
User: Please help me create tests for CreateUserValidator
AI: Sure, I'll write the tests for you... (starts writing code directly without loading sub-skills)
📚 Complete Skill List
To view the complete list of 19 basic skills, detailed decision trees, and learning path recommendations, please continue reading the rest of this document.
For human developers reference: For quick lookup, please check
SKILLS_QUICK_INDEX.md
Applicable Scenarios
I will help you find the right skill when you encounter the following situations:
- Just starting to learn .NET testing and don't know where to begin
- Want to create tests for an existing project and need complete guidance
- Need to improve test quality and look for best practices
- Encounter specific testing scenarios and are unsure which tool to use
- Want to learn about test data generation, assertions, mocking, and other techniques
- Hope to improve test readability and maintainability
- Need to handle special testing scenarios such as time, file systems, etc.
Quick Decision Tree
Where should I start?
Scenario 1: Complete beginner, never written tests before
Recommended Learning Path:
dotnet-testing-unit-test-fundamentals
- Understand FIRST principles and 3A Pattern
dotnet-testing-test-naming-conventions
- Learn naming conventions
dotnet-testing-xunit-project-setup
- Create your first test project
Why learn this way:
- FIRST principles are the foundation of all testing, establish correct concepts first
- Naming conventions make tests readable and maintainable
- Actually create a project to turn theory into practice
Scenario 2: Can write basic tests but preparing test data is cumbersome
Recommended Skills (choose one or combine):
Option A - Automation First
→
dotnet-testing-autofixture-basics
Suitable for: Need large amounts of test data, reduce boilerplate code
Option B - Realistic Data First
→
dotnet-testing-bogus-fake-data
Suitable for: Need realistic test data (names, addresses, emails, etc.)
Option C - Semantic Clarity First
→
dotnet-testing-test-data-builder-pattern
Suitable for: Need high readability, clearly express test intent
Option D - Best of Both Worlds
→
dotnet-testing-autofixture-basics
+
dotnet-testing-autofixture-bogus-integration
Suitable for: Need both automation and realistic data
Scenario 3: Have external dependencies (databases, APIs, third-party services) that need mocking
Recommended Skill Combination:
dotnet-testing-nsubstitute-mocking
- NSubstitute Mock framework basics
dotnet-testing-autofixture-nsubstitute-integration
- (Optional) Integrate AutoFixture with NSubstitute
When to use the second skill:
- If you are already using AutoFixture to generate test data
- Want to automatically create Mock objects and reduce manual configuration
Scenario 4: Have special scenarios in testing
Time-related Testing
→
dotnet-testing-datetime-testing-timeprovider
Handles: DateTime.Now, time zone conversion, time calculations
File System Testing
→
dotnet-testing-filesystem-testing-abstractions
Handles: File reading/writing, directory operations, path handling
Private/Internal Member Testing
→
dotnet-testing-private-internal-testing
Handles: Need to test private, internal members (but use cautiously)
Scenario 5: Need better assertion methods
Basic Need - Fluent Assertions
→
dotnet-testing-awesome-assertions-guide
Should be used in all projects to improve test readability
Advanced Need - Complex Object Comparison
→
dotnet-testing-complex-object-comparison
Handles: Deep object comparison, DTO validation, Entity comparison
Validation Rule Testing
→
dotnet-testing-fluentvalidation-testing
Handles: Testing FluentValidation validators
Scenario 6: Want to learn about test coverage
→
dotnet-testing-code-coverage-analysis
Learn: Use Coverlet to analyze code coverage, generate reports
Skill Classification Map
Divide 19 basic skills into 7 major categories (Testing Fundamentals, Test Data Generation, Test Doubles, Assertion Validation, Special Scenarios, Test Metrics, Framework Integration), each category includes a skill reference table, learning path, and code examples.
📖 For detailed content, please refer to references/skill-classification-map.md
Common Task Mapping Table
Provides skill combination recommendations, implementation steps, and prompt examples for 7 common testing tasks (create project from scratch, service dependency testing, time logic testing, etc.).
📖 For detailed content, please refer to references/task-mapping-table.md
Learning Path Recommendations
Plans daily learning schedules for beginner paths (1-2 weeks) and advanced paths (2-3 weeks), including skills, learning focus, and practical exercises.
📖 For detailed content, please refer to references/learning-paths.md
Guided Conversation Examples
Demonstrates how AI interacts with you to help you choose the right skill, including 4 common conversation scenarios: beginner introduction, handling dependencies, specific problems, improving tests, etc.
📖 For detailed content, please refer to references/conversation-examples.md
Relationship with Advanced Skills
After completing the basic skills, if you need to perform integration testing, API testing, containerized testing, or microservices testing, please refer to:
Advanced Integration Testing →
- ASP.NET Core integration testing
- Containerized testing (Testcontainers)
- Microservices testing (.NET Aspire)
- Testing framework upgrade and migration
Related Resources
Original Data Sources
-
iThome Ironman Series Articles:
Testing Practice for Old-School Software Engineers - 30-Day Challenge
🏆 2025 iThome Ironman Competition Software Development Group Champion
-
Complete Sample Code:
30Days_in_Testing_Samples
Contains executable code for all sample projects
Learning Documents
This skill set is refined based on the following complete teaching materials:
-
Agent Skills: From Architecture Design to Practical Application (docs/Agent_Skills_Mastery.pdf)
Fully covers Agent Skills from theory to practice
-
Claude Code Skills: Turn AI into a Professional Artisan (docs/Agent_Skills_Architecture.pdf)
In-depth analysis of Agent Skills architecture design
-
.NET Testing: Write Better, Run Faster (docs/NET_Testing_Write_Better_Run_Faster.pdf)
Test execution optimization and debugging techniques
Next Steps
Choose the skill that meets your needs to start learning, or tell me your specific situation and I will recommend the most suitable learning path!
Quick Start:
- Beginners → Start with
dotnet-testing-unit-test-fundamentals
- Experienced → Tell me the specific problem you encountered
- Unsure → Tell me about your project and I will help you analyze it