Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@MO2k4
Copy link
Owner

@MO2k4 MO2k4 commented Sep 23, 2025

  • Add MO.CleanCode.Tests project with ReSharper Test Framework integration
  • Create test base class and structure for analyzer unit testing
  • Implement tests for core analyzers:
    • TooManyDependencies: Interface dependency counting and settings
    • ClassTooBig: Method counting with proper exclusions
    • MethodTooLong: Statement and declaration count limits
  • Add comprehensive test data with realistic C# code samples
  • Enable testDotNet task in Gradle build pipeline
  • Update CLAUDE.md with testing documentation and workflow
  • Tests now run automatically before building and publishing

🤖 Generated with Claude Code

MO2k4 and others added 7 commits September 23, 2025 08:28
- Add MO.CleanCode.Tests project with ReSharper Test Framework integration
- Create test base class and structure for analyzer unit testing
- Implement tests for core analyzers:
  * TooManyDependencies: Interface dependency counting and settings
  * ClassTooBig: Method counting with proper exclusions
  * MethodTooLong: Statement and declaration count limits
- Add comprehensive test data with realistic C# code samples
- Enable testDotNet task in Gradle build pipeline
- Update CLAUDE.md with testing documentation and workflow
- Tests now run automatically before building and publishing

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <[email protected]>
Implement comprehensive test suites for 8 additional analyzers:

- ExcessiveIndentation: Tests nesting depth limits in if/for/while/try-catch
- ChainedReferences: Tests Law of Demeter violations with fluent API support
- TooManyMethodArguments: Tests parameter count limits for all method types
- FlagArguments: Tests boolean/enum parameters used in if statements
- ComplexExpression: Tests operator complexity in conditions and assignments
- MethodNameNotMeaningful: Tests minimum method name length requirements
- HollowNames: Tests generic class name suffixes (Manager, Handler, etc.)
- TooManyPublicMethods: Tests public method count limits per class

Each test suite includes:
- Positive and negative test cases with edge cases
- Custom settings validation
- Different code constructs (classes, interfaces, abstract classes)
- Comprehensive test data with realistic code samples
- Message validation and boundary testing

Total test coverage now spans all 11 CleanCode analyzers with 800+ lines
of test code and extensive test data scenarios.

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <[email protected]>
Replace HTML-encoded angle brackets (&lt; and &gt;) with proper
C# generic syntax (< and >) in all test files. This fixes:

- Generic type declarations like List<int>
- Generic method calls like .OfType<TType>()
- Generic class definitions and usage

The .csproj file was already correct with proper XML syntax.
All test files now use valid C# syntax for generics.

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <[email protected]>
- Rename duplicate class names to avoid conflicts:
  * SmallClass → SmallPublicMethodsClass
  * EmptyClass → EmptyPublicMethodsClass
  * ITestInterface → IMethodArgumentsTestInterface
  * AbstractTestClass → MethodArgumentsAbstractTestClass

- Simplify CleanCodeTestBase to avoid missing ReSharper test framework dependencies
- Update test references to use renamed classes
- Keep original project file structure with $(SdkVersion) reference

Resolves CS0101 and CS0111 compilation errors while maintaining
test structure for future ReSharper integration.

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <[email protected]>
…mbeddedResource

The ThemedIconsPacker task was failing due to missing Microsoft.Build.Utilities.v4.0 dependency.
Replaced ThemedIconPng items with EmbeddedResource to avoid the incompatible build task.

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <[email protected]>
Removed the GitHubActions logger from dotnet test commands to fix compatibility issues.
The default logger works in all environments and GitHub Actions still captures test results.

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <[email protected]>
@sonarqubecloud
Copy link

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants