Example #1
0
 public TestCaseFullDto()
 {
     Id                  = "";
     ParentId            = "";
     GhprTestRun         = new TestRunDto();
     GhprTestOutput      = new TestOutputDto();
     GhprTestScreenshots = new List <TestScreenshotDto>();
 }
Example #2
0
        public void DeleteTest(TestRunDto testRun)
        {
            _dataWriterLogger.Debug($"Deleting test run with guid = {testRun.TestInfo.Guid}");
            var tests = AllTestRunDtos ?? new List <TestRunDto>();

            tests.RemoveAll(tr => tr.TestInfo.Guid.Equals(testRun.TestInfo.Guid) && tr.TestInfo.Finish.Equals(testRun.TestInfo.Finish));
            tests.Add(testRun);
            _cache.Set(AllTestRunDtosKey, tests, Offset);
        }
Example #3
0
        public void DeleteTestOutput(TestRunDto testRun, TestOutputDto testOutput)
        {
            _dataWriterLogger.Debug($"Deleting test run output with guid = {testRun.TestInfo.Guid}");
            var outputs = AllTestOutputDtos ?? new List <TestOutputDto>();

            outputs.RemoveAll(o => o.TestOutputInfo.Date.Equals(testOutput.TestOutputInfo.Date) &&
                              o.TestOutputInfo.ItemName.Equals(testOutput.TestOutputInfo.ItemName));
            outputs.Add(testOutput);
            _cache.Set(AllTestOutputDtosKey, outputs, Offset);
        }
Example #4
0
        public TestOutputDto GetTestOutput(TestRunDto test)
        {
            _dataReaderLogger.Debug("Getting test output from Common cache");
            if (test == null)
            {
                return(null);
            }
            var testOutput = AllTestOutputDtos?.FirstOrDefault(to => to.TestOutputInfo.Equals(test.Output));

            return(testOutput);
        }
Example #5
0
        public void DeleteTestScreenshot(TestRunDto testRun, TestScreenshotDto testScreenshot)
        {
            _dataWriterLogger.Debug($"Deleting test run screenshot with guid = {testRun.TestInfo.Guid}");
            var screens = AllTestScreenshotDtos ?? new List <TestScreenshotDto>();

            screens.RemoveAll(s => s.TestGuid.Equals(testScreenshot.TestGuid) &&
                              s.TestScreenshotInfo.Date.Equals(testScreenshot.TestScreenshotInfo.Date) &&
                              s.TestScreenshotInfo.ItemName.Equals(testScreenshot.TestScreenshotInfo.ItemName));
            screens.Add(testScreenshot);
            _cache.Set(AllTestScreenshotDtosKey, screens, Offset);
        }
Example #6
0
        public ItemInfoDto SaveTestRun(TestRunDto testRun, TestOutputDto testOutput)
        {
            _dataWriterLogger.Debug("Saving test run and output in Common cache");
            _cache.Set(testRun.TestInfo.Guid.ToString(), testRun, Offset);

            var tests = AllTestRunDtos ?? new List <TestRunDto>();

            tests.RemoveAll(tr => tr.TestInfo.Guid.Equals(testRun.TestInfo.Guid) && tr.TestInfo.Finish.Equals(testRun.TestInfo.Finish));
            tests.Add(testRun);
            _cache.Set(AllTestRunDtosKey, tests, Offset);

            var outputs = AllTestOutputDtos ?? new List <TestOutputDto>();

            outputs.RemoveAll(o => o.TestOutputInfo.Date.Equals(testOutput.TestOutputInfo.Date) &&
                              o.TestOutputInfo.ItemName.Equals(testOutput.TestOutputInfo.ItemName));
            outputs.Add(testOutput);
            _cache.Set(AllTestOutputDtosKey, outputs, Offset);
            _dataWriterLogger.Debug("Saving test run and output in Common cache: Done");
            return(testRun.TestInfo);
        }
Example #7
0
 public List <TestScreenshotDto> GetTestScreenshots(TestRunDto test)
 {
     _dataReaderLogger.Debug("Getting test screenshots from Common cache");
     return(AllTestScreenshotDtos?.Where(s => s.TestGuid.Equals(test.TestInfo.Guid) &&
                                         s.TestScreenshotInfo.Date >= test.TestInfo.Start && s.TestScreenshotInfo.Date <= test.TestInfo.Finish).ToList());
 }