Score as percentages
This commit is contained in:
parent
dfc0eeb323
commit
74aee54432
23 changed files with 1027 additions and 1488 deletions
|
|
@ -336,13 +336,13 @@ func TestGetRecommendations(t *testing.T) {
|
|||
name: "Results with score",
|
||||
results: &AnalysisResults{
|
||||
Score: &ScoringResult{
|
||||
OverallScore: 5.0,
|
||||
Rating: "Fair",
|
||||
AuthScore: 1.5,
|
||||
SpamScore: 1.0,
|
||||
BlacklistScore: 1.5,
|
||||
ContentScore: 0.5,
|
||||
HeaderScore: 0.5,
|
||||
OverallScore: 50,
|
||||
Grade: ScoreToReportGrade(50),
|
||||
AuthScore: 15,
|
||||
SpamScore: 10,
|
||||
BlacklistScore: 15,
|
||||
ContentScore: 5,
|
||||
HeaderScore: 5,
|
||||
Recommendations: []string{
|
||||
"Improve authentication",
|
||||
"Fix content issues",
|
||||
|
|
@ -381,19 +381,19 @@ func TestGetScoreSummaryText(t *testing.T) {
|
|||
name: "Results with score",
|
||||
results: &AnalysisResults{
|
||||
Score: &ScoringResult{
|
||||
OverallScore: 8.5,
|
||||
Rating: "Good",
|
||||
AuthScore: 2.5,
|
||||
SpamScore: 1.8,
|
||||
BlacklistScore: 2.0,
|
||||
ContentScore: 1.5,
|
||||
HeaderScore: 0.7,
|
||||
OverallScore: 85,
|
||||
Grade: ScoreToReportGrade(85),
|
||||
AuthScore: 25,
|
||||
SpamScore: 18,
|
||||
BlacklistScore: 20,
|
||||
ContentScore: 15,
|
||||
HeaderScore: 7,
|
||||
CategoryBreakdown: map[string]CategoryScore{
|
||||
"Authentication": {Score: 2.5, MaxScore: 3.0, Percentage: 83.3, Status: "Pass"},
|
||||
"Spam Filters": {Score: 1.8, MaxScore: 2.0, Percentage: 90.0, Status: "Pass"},
|
||||
"Blacklists": {Score: 2.0, MaxScore: 2.0, Percentage: 100.0, Status: "Pass"},
|
||||
"Content Quality": {Score: 1.5, MaxScore: 2.0, Percentage: 75.0, Status: "Warn"},
|
||||
"Email Structure": {Score: 0.7, MaxScore: 1.0, Percentage: 70.0, Status: "Warn"},
|
||||
"Authentication": {Score: 25, Status: "Pass"},
|
||||
"Spam Filters": {Score: 18, Status: "Pass"},
|
||||
"Blacklists": {Score: 20, Status: "Pass"},
|
||||
"Content Quality": {Score: 15, Status: "Warn"},
|
||||
"Email Structure": {Score: 7, Status: "Warn"},
|
||||
},
|
||||
},
|
||||
},
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue