Overview
The core logic in ScoringEngine.cs and RedFlagAnalyzer.cs has
no unit tests. This makes it risky to change scoring logic
without knowing if something broke.
What needs to be done
Create a new test project JobTruth.Tests and write xUnit tests.
Setup
cd JobTruth
dotnet new xunit -n JobTruth.Tests
dotnet sln add JobTruth.Tests/JobTruth.Tests.csproj
cd JobTruth.Tests
dotnet add reference ../JobTruth.API/JobTruth.API.csproj
Tests needed
ScoringEngine tests
- Score starts at 100
- FAIL check deducts correct points
- Score never goes below 0
- Verdict is "Looks Legitimate" when score >= 80
- Verdict is "Proceed with Caution" when score 50-79
- Verdict is "High Risk" when score < 50
RedFlagAnalyzer tests
- Returns PASS when description is clean
- Detects "registration fee" pattern
- Detects "whatsapp your cv" pattern
- Deduction is capped at 40 points
- Returns FAIL when 3+ flags found
Acceptance criteria
Overview
The core logic in ScoringEngine.cs and RedFlagAnalyzer.cs has
no unit tests. This makes it risky to change scoring logic
without knowing if something broke.
What needs to be done
Create a new test project
JobTruth.Testsand write xUnit tests.Setup
Tests needed
ScoringEngine tests
RedFlagAnalyzer tests
Acceptance criteria