Test-Dokumentation aktualisiert (80 Tests gesamt)
README.md aktualisiert mit vollständiger Übersicht:
Übersicht:
- 54 Unit Tests (LessonService, StatisticsService, SettingsService)
- 26 Integration Tests (ProgressService, StatisticsService mit DB)
- Gesamt: 80 Tests, alle bestanden ✅
Neue Sektionen:
- Separate Tabellen für Unit/Integration Tests
- Integration Test Details hinzugefügt
- Ausführungsbeispiele für verschiedene Test-Typen
- Detaillierte Coverage-Beschreibungen
Ausführung:
- Unit Tests: python -m unittest tests.test_*_service -v
- Integration Tests: python -m unittest tests.test_integration_* -v
- Alle Tests: python -m unittest discover -s tests -p "test_*.py" -v
This commit is contained in:
parent
94819bee71
commit
0aa6f108f7
1 changed files with 54 additions and 7 deletions
|
|
@ -4,7 +4,7 @@ Dieses Verzeichnis enthält Unit Tests für die Service-Layer der Typewriter Tra
|
|||
|
||||
## Test-Übersicht
|
||||
|
||||
### Erfolgreich getestete Services
|
||||
### Unit Tests (ohne Datenbankzugriff)
|
||||
|
||||
| Service | Test-Datei | Anzahl Tests | Status |
|
||||
|---------|-----------|--------------|--------|
|
||||
|
|
@ -12,7 +12,20 @@ Dieses Verzeichnis enthält Unit Tests für die Service-Layer der Typewriter Tra
|
|||
| **StatisticsService** | `test_statistics_service.py` | 15 | ✅ Alle bestanden |
|
||||
| **SettingsService** | `test_settings_service.py` | 22 | ✅ Alle bestanden |
|
||||
|
||||
**Gesamt:** 54 Tests, alle bestanden ✅
|
||||
**Gesamt Unit Tests:** 54 Tests, alle bestanden ✅
|
||||
|
||||
### Integration Tests (mit Datenbank)
|
||||
|
||||
| Service | Test-Datei | Anzahl Tests | Status |
|
||||
|---------|-----------|--------------|--------|
|
||||
| **ProgressService** | `test_integration_progress.py` | 12 | ✅ Alle bestanden |
|
||||
| **StatisticsService** | `test_integration_statistics.py` | 14 | ✅ Alle bestanden |
|
||||
|
||||
**Gesamt Integration Tests:** 26 Tests, alle bestanden ✅
|
||||
|
||||
### Gesamtübersicht
|
||||
|
||||
**Gesamt:** 80 Tests (54 Unit + 26 Integration), **alle bestanden** ✅
|
||||
|
||||
### Hinweise
|
||||
|
||||
|
|
@ -31,7 +44,7 @@ Dieses Verzeichnis enthält Unit Tests für die Service-Layer der Typewriter Tra
|
|||
- Fehlerbehandlung bei ungültigen Indizes
|
||||
- Edge Cases (leere Lektionen, Grenzen)
|
||||
|
||||
#### StatisticsService (15 Tests)
|
||||
#### StatisticsService Unit Tests (15 Tests)
|
||||
- Tippstatistik-Berechnungen (ZPM, WPM)
|
||||
- Fehlerraten-Berechnung
|
||||
- Genauigkeitsberechnung
|
||||
|
|
@ -40,6 +53,27 @@ Dieses Verzeichnis enthält Unit Tests für die Service-Layer der Typewriter Tra
|
|||
- Edge Cases (leere Eingabe, zu schnelle Eingabe)
|
||||
- Rundung und Formatierung
|
||||
|
||||
#### ProgressService Integration Tests (12 Tests)
|
||||
- get_or_create_global_progress (creates new/returns existing)
|
||||
- get/set_current_lesson_index
|
||||
- get_or_create_lesson_progress (creates new/returns existing)
|
||||
- update_lesson_progress
|
||||
- reset_lesson_progress
|
||||
- get_lesson_progress_data (with data/creates if missing)
|
||||
- complete_lesson
|
||||
- multiple_lessons_independent
|
||||
|
||||
#### StatisticsService Integration Tests (14 Tests)
|
||||
- save_lesson_statistics
|
||||
- has_lesson_statistics (true/false)
|
||||
- get_lesson_statistics_data (with data/empty)
|
||||
- delete_lesson_statistics (single/preserve others)
|
||||
- get_all_statistics
|
||||
- update_daily_practice (creates new/accumulates)
|
||||
- get_full_30_days_practice (with gaps filled/all zeros)
|
||||
- daily_practice_separate_days
|
||||
- end_to_end_statistic_save
|
||||
|
||||
#### SettingsService (22 Tests)
|
||||
- Validierung aller Einstellungsparameter:
|
||||
- Metronom-Modus (automatic/explicit)
|
||||
|
|
@ -70,14 +104,17 @@ Dieses Verzeichnis enthält Unit Tests für die Service-Layer der Typewriter Tra
|
|||
### Alle Tests ausführen
|
||||
|
||||
```bash
|
||||
# Alle Tests im tests/ Verzeichnis
|
||||
# Alle Unit Tests
|
||||
python -m unittest discover -s tests -p "test_*.py" -v
|
||||
|
||||
# Oder einfach:
|
||||
python -m unittest discover tests -v
|
||||
# Alle Integration Tests
|
||||
python -m unittest discover -s tests -p "test_integration_*.py" -v
|
||||
|
||||
# NUR Unit Tests (ohne Integration)
|
||||
python -m unittest tests.test_lesson_service tests.test_statistics_service tests.test_settings_service -v
|
||||
```
|
||||
|
||||
### Einzelne Test-Dateien
|
||||
### Unit Tests (einzeln)
|
||||
|
||||
```bash
|
||||
# LessonService Tests
|
||||
|
|
@ -90,6 +127,16 @@ python -m unittest tests.test_statistics_service -v
|
|||
python -m unittest tests.test_settings_service -v
|
||||
```
|
||||
|
||||
### Integration Tests (einzeln)
|
||||
|
||||
```bash
|
||||
# ProgressService Integration Tests
|
||||
python -m unittest tests.test_integration_progress -v
|
||||
|
||||
# StatisticsService Integration Tests
|
||||
python -m unittest tests.test_integration_statistics -v
|
||||
```
|
||||
|
||||
### Einzelne Test-Klassen
|
||||
|
||||
```bash
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue