public void Given_Valid_Arguments_When_ReadLatestResult_Invoked_Then_valid_Results_Asserted() { codeAnalysisRepo.Add("Admin", "github.com", "master", Tools.Resharper, 5, -1); Thread.Sleep(1000); codeAnalysisRepo.Add("Admin", "github.com", "master", Tools.Resharper, 4, -1); Thread.Sleep(1000); codeAnalysisRepo.Add("Admin", "github.com", "master", Tools.Resharper, 2, -1); Assert.AreEqual(-1, codeAnalysisRepo.ReadLatestResult("Admin", "github.com", "master", Tools.Resharper)[0]); Assert.AreEqual(2, codeAnalysisRepo.ReadLatestResult("Admin", "github.com", "master", Tools.Resharper)[1]); }
public bool AbsoluteGate(int threshold, string userName, Tools tool, string repository, string branch) { var result = userCodeAnalysisRepo.ReadLatestResult(userName, repository, branch, tool); if (!result.Any()) { return(false); } if (result[0] == -1) { userCodeAnalysisRepo.UpdateThreshold(userName, repository, tool, branch, threshold, result[1]); } return(result[1] <= threshold); }