Пример #1
0
        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));
        }
Пример #2
0
 public bool IsPlayerTestStateGreen()
 {
     return(LatestResult.IsPlayerTestStateGreen());
 }