# Generate Tests — TestApp

Generates comprehensive unit, widget, and integration tests for **BLoC / Cubit** patterns.

## Usage
```
Generate tests for [ClassName or file path]
```

## Test generation process
1. Read the source file completely
2. Identify all testable units (public methods, state transitions, UI states)
3. Generate tests following this pattern:
   ```
   blocTest<MyCubit, MyState>(description, build: () => MyCubit(), act: (c) => c.method(), expect: () => [MyState()])
   ```
4. Create mocks with `mocktail` for all dependencies
5. Place test file at `test/[mirror of source path]_test.dart`

## Coverage targets
- Business logic (UseCases, Repositories, BLoC/Notifiers): **80% minimum**
- Widget tests: all three states (loading/error/data) must be tested
- E2E: only critical user flows

## Test file structure
```dart
void main() {
  // Setup
  group('[ClassName]', () {
    // Happy path tests
    group('success cases', () { ... });
    // Error path tests  
    group('error cases', () { ... });
    // Edge cases
    group('edge cases', () { ... });
  });
}
```

## Naming convention
`'given [precondition], when [action], then [expected outcome]'`
