protected override void Logic(ValidationTarget target) { var path = target.GetBaseFolderPath(); var di = new DirectoryInfo(path); var folderSize = GetDirectorySize(di); if (folderSize > limit) { var excess = folderSize - limit; var reference = AssetDatabase.LoadMainAssetAtPath(path); var message = LocalizedMessage.Get("FolderSizeRule.Exceeded", SIReadableNumberText.Get(limit, "B"), SIReadableNumberText.Get(folderSize, "B"), SIReadableNumberText.Get(excess, "B")); var solution = LocalizedMessage.Get("FolderSizeRule.Exceeded.Solution"); var solutionURL = LocalizedMessage.Get("FolderSizeRule.Exceeded.SolutionURL"); AddIssue(new Issue(reference, IssueLevel.Error, message, solution, solutionURL)); } }
public void TestUnit(string unit, string expected) { Assert.AreEqual(expected, SIReadableNumberText.Get(1000, unit)); }
public void TestDigit(long input, string expected) { Assert.AreEqual(expected, SIReadableNumberText.Get(input, "B")); }