internal ProgressEvent CheckImplementationLevel() { if (!LatestResult.IsPlayerTestStateGreen()) { return(null); } var currentLevel = LatestResult.PlayerImplementationLevel; var passingResults = _results.Where(result => result.IsPlayerTestStateGreen()).ToList(); if (passingResults.Count(result => result.PlayerImplementationLevel == currentLevel) > 1 && !IsKataCompleted()) { return(null); } var previousPassingLevelResult = passingResults .Where(result => result != LatestResult) .OrderByDescending(result => result.PlayerImplementationLevel) .ThenBy(result => result.Time) .FirstOrDefault(result => result.PlayerImplementationLevel < currentLevel); if (previousPassingLevelResult == null) { return(null); } return(CreateProgressEvent(LatestResult, _results, previousPassingLevelResult)); }
public bool IsPlayerTestStateGreen() { return(LatestResult.IsPlayerTestStateGreen()); }