Exemplo n.º 1
0
        private string CreateJsonObject(PlayerImplementationRunResult playerImplementationRunResult,
                                        PlayerTestsRunResult playerTestsRunResult,
                                        PlayerFeedback playerFeedback,
                                        string attemptName,
                                        IKataraiApp kataraiApp,
                                        string playerPath,
                                        IFileSystem fileSystem)
        {
            var attemptCreationTime = GetAttemptCreationTime(attemptName);

            var kataStartTime = GetKataStartTime(attemptCreationTime, kataraiApp);

            return(JsonConvert.SerializeObject(new
            {
                userName = GetUserName(),
                attemptName,
                timestamp = GetTimestamp(),
                attemptCreationTime,
                kataStartTime,
                playerImplementationRunResult,
                playerTestsRunResult,
                overallAnalysisResult = playerFeedback,
                appVersion = GetAppVersion(),
                kataName = _kataHelper.GetKataName(attemptName),
                kata = GetKataFilesContents(playerPath, fileSystem)
            }, new JsonSerializerSettings
            {
                ContractResolver = new CamelCasePropertyNamesContractResolver(),
                NullValueHandling = NullValueHandling.Ignore
            }));
        }
Exemplo n.º 2
0
        private static OverallAnalysisResult GetOverallAnalysisResult(
            PlayerImplementationRunResult playerImplementationRunResult, PlayerTestsRunResult playerTestsRunResult,
            PlayerTestsPlayerImplementationRunResult playerTestsPlayerImplementationRunResult, Type kataTestsType)
        {
            var testMethodsRetriever = new TestMethodsRetriever();
            var goldenTestMethods    = testMethodsRetriever.GetTestMethods(kataTestsType);

            var overallAnalysisResult = new OverallAnalysisResult(
                playerImplementationRunResult,
                playerTestsRunResult,
                playerTestsPlayerImplementationRunResult,
                goldenTestMethods);

            return(overallAnalysisResult);
        }
Exemplo n.º 3
0
        public int GetMinLevelEdgeCasesNotCovered(PlayerTestsRunResult playerTestsRunResult)
        {
            var playerTestsEdgeCoverageResults = playerTestsRunResult.PlayerTestsEdgeCoverageResults;
            var minLevelEdgeCasesNotCovered    = playerTestsRunResult.Level;

            if (playerTestsEdgeCoverageResults != null)
            {
                var edgeCasesNotCoveredResults =
                    playerTestsEdgeCoverageResults.Where(result => !result.IsCovered).ToList();
                if (edgeCasesNotCoveredResults.Any())
                {
                    minLevelEdgeCasesNotCovered = edgeCasesNotCoveredResults.Min(result => result.Level);
                }
            }
            return(minLevelEdgeCasesNotCovered);
        }
Exemplo n.º 4
0
        public void Log(PlayerImplementationRunResult playerImplementationRunResult,
                        PlayerTestsRunResult playerTestsRunResult,
                        PlayerFeedback playerFeedback,
                        IKataraiApp kataraiApp,
                        IFileSystem fileSystem)
        {
            var playerPath  = GetPlayerPath(kataraiApp);
            var attemptName = GetAttemptName(playerPath);

            if (!attemptName.Contains("-"))
            {
                return;
            }
            var jsonObject = CreateJsonObject(playerImplementationRunResult, playerTestsRunResult, playerFeedback, attemptName, kataraiApp, playerPath, fileSystem);

            _splunkAppender.Log(jsonObject, "katarai");
        }
Exemplo n.º 5
0
 public ResultFake(PlayerImplementationRunResult playerImplementationRunResult, PlayerTestsRunResult playerTestsRunResult, PlayerFeedback playerFeedback)
     : base(playerImplementationRunResult, playerTestsRunResult, playerFeedback)
 {
 }
Exemplo n.º 6
0
 public OverallAnalysisResult(PlayerImplementationRunResult playerImplementationRunResult, PlayerTestsRunResult playerTestsRunResult, PlayerTestsPlayerImplementationRunResult playerTestsPlayerImplementationRunResult, ITestMethod[] goldenTestMethods)
 {
     this.PlayerImplementationRunResult            = playerImplementationRunResult;
     this.PlayerTestsRunResult                     = playerTestsRunResult;
     this.PlayerTestsPlayerImplementationRunResult = playerTestsPlayerImplementationRunResult;
     this.GoldenTestMethods = goldenTestMethods;
 }
Exemplo n.º 7
0
 public Result(PlayerImplementationRunResult playerImplementationRunResult, PlayerTestsRunResult playerTestsRunResult, PlayerFeedback playerFeedback) :
     this(playerImplementationRunResult.Level, playerTestsRunResult.Level, playerFeedback)
 {
     PlayerImplementationRunResult = playerImplementationRunResult;
     PlayerTestsRunResult          = playerTestsRunResult;
 }