Repository navigation
Contributing
IchiSamaFR edited this page May 13, 2026
·
1 revision
Thank you for your interest in contributing to MermaidSharp!
- Target Framework: Core libraries and tests target .NET Framework 4.8 and .NET 8.0 (sample apps target .NET 9).
- Language: C# for all code.
- Readability: Write clear, self-explanatory code with meaningful names.
- SOLID Principles: Adhere to SOLID design principles.
- One class per file: Organize files into appropriate folders by feature or layer.
- XML Documentation: All public types and members must include XML documentation comments.
| Element | Convention | Example |
|---|---|---|
| Classes & Interfaces | PascalCase |
UserService, IUserRepository
|
| Methods & Properties | PascalCase | GetUserById |
| Private & public variables | camelCase |
_userId, userId
|
| Parameters | camelCase | userId |
| Constants | PascalCase | DefaultTimeout |
| Unit test methods | Descriptive scenario | GetUserById_ReturnsUser_WhenUserExists |
- Braces: Allman style (braces on new lines).
- Indentation: One tab per indentation level.
- Line Length: Limit lines to 120 characters.
-
Usings: Place
usingstatements outside the namespace. Remove unused usings.
- Framework: MSTest
-
Naming:
MethodName_ExpectedBehavior_StateUnderTest - Structure: Arrange-Act-Assert (AAA) pattern
- Isolation: Each test must be independent
- Mocking: Use mocks or fakes for external dependencies
dotnet test src/MermaidSharp.sln -c Release- Fork the repository.
- Create a feature branch from
main. - Implement your changes following the coding standards above.
- Ensure all existing tests pass and add new tests for your changes.
- Open a pull request with a clear description of the changes.
For more details, see .github/copilot-instructions.md.