Skip to content

Commit

Permalink
Merge pull request #207 from samsmithnz/UpdatedLanguageAccuracy
Browse files Browse the repository at this point in the history
Updated language accuracy
  • Loading branch information
samsmithnz committed Jan 1, 2023
2 parents 506bcb6 + 6b6480f commit 8810117
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion src/RepoAutomation.Core/Helpers/RepoLanguageHelper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ public static List<RepoLanguage> TransformRepoLanguages(Dictionary<string, int>
{
Name = item.Key,
Total = item.Value,
Percent = Math.Round((decimal)item.Value / total,4)
Percent = Math.Round((decimal)item.Value / total,2)
});
}

Expand Down
10 changes: 5 additions & 5 deletions src/RepoAutomation.Tests/RepoTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -267,15 +267,15 @@ public async Task GetRepoLanguagesWithHelperTest()
Assert.IsNotNull(repoLanguages);
Assert.AreEqual(5, repoLanguages.Count);
Assert.AreEqual("C#", repoLanguages[0].Name);
Assert.AreEqual(0.9403M, repoLanguages[0].Percent);
Assert.AreEqual(0.94M, repoLanguages[0].Percent);
Assert.AreEqual("HTML", repoLanguages[1].Name);
Assert.AreEqual(0.0375M, repoLanguages[1].Percent);
Assert.AreEqual(0.04M, repoLanguages[1].Percent);
Assert.AreEqual("CSS", repoLanguages[2].Name);
Assert.AreEqual(0.0104M, repoLanguages[2].Percent);
Assert.AreEqual(0.01M, repoLanguages[2].Percent);
Assert.AreEqual("Dockerfile", repoLanguages[3].Name);
Assert.AreEqual(0.0095M, repoLanguages[3].Percent);
Assert.AreEqual(0.01M, repoLanguages[3].Percent);
Assert.AreEqual("JavaScript", repoLanguages[4].Name);
Assert.AreEqual(0.0022M, repoLanguages[4].Percent);
Assert.AreEqual(0.0M, repoLanguages[4].Percent);
}

}

0 comments on commit 8810117

Please sign in to comment.