Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions .claude/rules/event-patterns.md
Original file line number Diff line number Diff line change
Expand Up @@ -69,13 +69,13 @@ void OnTextChanged (object sender, EventArgs e) { }

## Local Function Naming

**Use camelCase for local functions:**
**Use PascalCase for local functions** (the `.editorconfig` `local_functions_rule` enforces `upper_camel_case_style` at `warning` severity):

```csharp
// CORRECT
void textViewDrawContent (object? sender, DrawEventArgs e) { }
void TextViewDrawContent (object? sender, DrawEventArgs e) { }

// WRONG
void TextView_DrawContent (object? sender, DrawEventArgs e) { }
void TextViewDrawContent (object? sender, DrawEventArgs e) { }
void textViewDrawContent (object? sender, DrawEventArgs e) { }
```
12 changes: 6 additions & 6 deletions .claude/rules/testing-patterns.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
3. **Follow existing test patterns**
- Study tests in respective test projects before writing new ones

4. **Avoid adding new tests to `UnitTests` Project**
4. **Never add new tests to `UnitTests.Legacy`**
- Make them parallelizable and add them to `UnitTestsParallelizable`

5. **Avoid static dependencies**
Expand All @@ -38,7 +38,7 @@

## Test Projects

### 1. Non-Parallel Tests (`Tests/UnitTests/`)
### 1. Non-Parallel Tests (`Tests/UnitTests.NonParallelizable/`)

**When to use:**
- Testing functionality that depends on static state
Expand All @@ -48,11 +48,10 @@
- ~10 min timeout
- Uses `Application.Init` and static state
- Cannot run in parallel
- Includes `--diagnostic` flag for logging

**Command:**
```bash
dotnet test --project Tests/UnitTests --no-build --verbosity normal
dotnet test --project Tests/UnitTests.NonParallelizable --no-build --verbosity normal
```

### 2. Parallel Tests (`Tests/UnitTestsParallelizable/`) - **PREFERRED**
Expand Down Expand Up @@ -84,8 +83,9 @@ dotnet test --project Tests/IntegrationTests --no-build --verbosity normal

## Test Configuration Files

- `xunit.runner.json` - xUnit configuration
- `coverlet.runsettings` - Coverage settings (currently unused, pending MTP integration)
- `xunit.runner.json` - Per-project xUnit configuration (parallelization, etc.)
- `Tests/TestEnvironmentSetup.cs` - Compiled into every test project; its `[ModuleInitializer]` sets `DisableRealDriverIO=1` before any test code runs
- Coverage tooling: each test project references the `coverlet.collector` package, but coverage is not actively collected in CI yet (see "Code Coverage" above — pending an MTP-compatible solution). `.runsettings` files are ignored by Microsoft Testing Platform (MTP).

## Example Test Pattern

Expand Down
9 changes: 6 additions & 3 deletions CLAUDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ See `.claude/rules/` for detailed guidance:
- `event-patterns.md` - Lambdas, closures, handlers
- `early-return.md` - **Guard clauses, minimal nesting** (commonly violated!)
- `collection-expressions.md` - Use `[...]` syntax
- `unicode-graphemes.md` - **Think in graphemes** - `GetColumns()`, `GraphemeHelper.GetGraphemes()`
- `cwp-pattern.md` - Cancellable Workflow Pattern
- `code-layout.md` - Backing fields, member ordering
- `api-documentation.md` - XML documentation requirements
Expand All @@ -63,7 +64,6 @@ See `.claude/rules/` for detailed guidance:
## Task-Specific Guides

See `.claude/tasks/` for task checklists:
- `scenario-modernization.md` - Upgrading UICatalog scenarios
- `clean-code-review.md` - Creating clean git commit histories
- `build-app.md` - Building applications with Terminal.Gui

Expand Down Expand Up @@ -100,8 +100,11 @@ dotnet test --project Tests/UnitTests.NonParallelizable --no-build
# Legacy tests — do NOT add new tests here; candidates for rewrite/deletion
dotnet test --project Tests/UnitTests.Legacy --no-build

# Run a single test by fully-qualified name
dotnet test --project Tests/UnitTestsParallelizable --no-build --filter "FullyQualifiedName~MyTestClass.MyTestMethod"
# Run a single test by method name (Microsoft Testing Platform)
dotnet test --project Tests/UnitTestsParallelizable --no-build --filter-method "*MyTestMethod"

# Run all tests in a class
dotnet test --project Tests/UnitTestsParallelizable --no-build --filter-class "*MyTestClass"
```

See `Tests/README.md` for the full list of test projects (including `IntegrationTests`, `StressTests`, `Benchmarks`) and the static-state classification that determines where a new test belongs.
Expand Down