Disable Code Duplication smells in tests

I feel fine with having a bit more code duplication in my tests than in other code. But I can’t seem to disable the warnings. I’ve tried both with comments and a config file.

My code is C#. I’ve added the hint as this:

```cs
[Fact] // @codescene(disable:"Code Duplication") public async Task CloseAccount_Should_FailOnWrongPassword() {
}
```

But the method is still marked as Code Duplication.

I’ve also created a .codescene/code-health-rules.json that looks like this:

```json
{ "usage": "Code Health", "rule_sets": [ { "matching_content_path": "Carehood.Api.IntegrationTests/**", "rules": [ { "name": "Code Duplication", "weight": 0.0 } ] } ] }
```

I still see the warning in both VS Code and Rider.

Please authenticate to join the conversation.

Upvoters
Status

Answered

Board

IDE Extensions

Date

5 months ago

Subscribe to post

Get notified by email when there are changes.