Skip to content

test(GradeBookApp): add 73 xunit tests covering grading logic#1928

Merged
jsboige merged 1 commit into
mainfrom
test/gradebookapp-xunit-73tests
May 31, 2026
Merged

test(GradeBookApp): add 73 xunit tests covering grading logic#1928
jsboige merged 1 commit into
mainfrom
test/gradebookapp-xunit-73tests

Conversation

@jsboige
Copy link
Copy Markdown
Owner

@jsboige jsboige commented May 31, 2026

Summary

Add xunit test project \GradeBookApp.Tests\ (net9.0) covering the pure/testable logic of the GradeBookApp grading console app.

Coverage (73 tests, 4 files)

File Tests Domain
\FoldAccentsTests.cs\ 15 Lucene accent folding (StandardAnalyzer + ASCIIFoldingFilter behavior)
\EvaluationRecordTests.cs\ 13 Note computation ((sum*2)/NbEvalFields), evaluator properties
\StudentRecordTests.cs\ 10 Moyenne, Sujets null-filtering, compatibility properties
\ProjectModelTests.cs\ 35 GroupEvaluation.Moyenne (weighted teacher/student avg), GroupSizeBonus (6-tier lookup), StatisticalNormalization (z-score + target mean/stdev + clamping), ProcessEvaluations filtering (auto-eval, double eval, non-inscrit, teacher marking), accent-insensitive IsMatch, HasStudent, NormalizationDelta, FinalGrade

Test results

  • 73 passed, 0 failed (\dotnet test)
  • Python suite: 1584 passed, 0 regression

Context

Coordinator dispatch (cycle 89): pivot from \scripts/smartcontracts/\ (empty — only LIVE script already tested in cycle 71) to GradeBookApp (.NET) coverage audit. Smartcontracts confirmed as dead-code lane per lesson #1885.

73 tests across 4 files covering:
- FoldAccents (15): Lucene accent folding behavior (tokenize+lowercase+ASCIIFold)
- EvaluationRecord (13): Note computation, evaluator properties
- StudentRecord (10): Moyenne, Sujets filtering, compatibility props
- ProjectModel (35): GroupEvaluation.Moyenne (weighted teacher/student),
  GroupSizeBonus (6-tier lookup), StatisticalNormalization (z-score),
  ProcessEvaluations filtering (auto-eval, double, non-inscrit),
  accent-insensitive name matching, HasStudent, NormalizationDelta

Build: 0 errors. Tests: 73 passed, 0 failed. Python suite: 1584 passed (0 regression).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Copy link
Copy Markdown
Collaborator

@clusterManager-Myia clusterManager-Myia left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[Hermes] — APPROVED

Security: CLEAN
Risk: Low (pure test code, no production logic changes)

Checklist:

  • ✅ 4 new test files covering EvaluationRecord, FoldAccents, ProjectModel, StudentRecord
  • ✅ 73 xunit tests with clear boundary testing (zero fields, max scores, edge cases)
  • ✅ Tests cover: grading formula, accent folding, normalization z-score, auto-eval rejection, group size bonus clamping
  • ✅ Proper test isolation — helper factories, no external dependencies
  • ✅ csproj correctly references main project, target net9.0
  • ✅ No secrets, no hardcoded values

Minor note: FoldAccentsTests uses reflection to access Program.FoldAccents — fragile if method signature changes, but acceptable for testing internal static methods in C#.

@jsboige jsboige merged commit 68da05f into main May 31, 2026
2 checks passed
@jsboige jsboige deleted the test/gradebookapp-xunit-73tests branch May 31, 2026 13:48
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