Exemple #1
0
        /// <summary>
        /// Get the GetHistoryErrorOccurrenceGroups for a testsystem
        /// </summary>
        /// <param name="errorResults">the list of error results</param>
        /// <returns>A List of ErrorOccurrenceGroups</returns>
        public static List <ErrorOccurrenceGroup> GetHistoryErrorOccurrenceGroups(IList <HistoryResult> errorResults)
        {
            List <ErrorOccurrenceGroup> occurrenceGroups = new List <ErrorOccurrenceGroup>();

            foreach (HistoryResult result in errorResults)
            {
                ErrorOccurrenceGroup errorOccurrenceGroup = occurrenceGroups.Find(objErrorOccurrenceGroupOther => objErrorOccurrenceGroupOther.Testcase.ID == result.Testcase.ID);
                if (errorOccurrenceGroup == null)
                {
                    errorOccurrenceGroup = new ErrorOccurrenceGroup {
                        Testcase = result.Testcase
                    };
                    occurrenceGroups.Add(errorOccurrenceGroup);
                }
                ErrorOccurrence errorOccurrence = errorOccurrenceGroup.LstErrorOccurence.Find(errorOccurrenceOther => result.Error != null && errorOccurrenceOther.Error.ID == result.Error.ID);
                if (errorOccurrence == null)
                {
                    Debug.Assert(result.Error != null, "result.Error != null");
                    errorOccurrence = new ErrorOccurrence {
                        Error = result.Error
                    };
                    errorOccurrenceGroup.LstErrorOccurence.Add(errorOccurrence);
                }
                OccurrenceElement occurrenceElement = new OccurrenceElement
                {
                    Browser        = result.Browser,
                    DateTime       = result.Testtime,
                    Language       = result.Language,
                    ScreenshotFile = result.ScreenshotFile,
                    DetailLog      = result.DetailLog
                };
                errorOccurrence.LstOccurence.Add(occurrenceElement);
            }
            return(occurrenceGroups);
        }
        public override bool Navigate(
            ISolution solution,
            PopupWindowContextSource windowContext,
            bool transferFocus,
            TabOptions tabOptions = TabOptions.Default)
        {
            var textControlManager = solution.GetComponent <ITextControlManager>();

            var declaredElement = OccurrenceElement.NotNull().GetValidDeclaredElement();

            if (declaredElement == null)
            {
                return(false);
            }

            foreach (var declaration in declaredElement.GetDeclarations())
            {
                var sourceFile = declaration.GetSourceFile();
                if (sourceFile == null)
                {
                    continue;
                }

                foreach (var textControl in textControlManager.TextControls)
                {
                    if (textControl.Document != sourceFile.Document)
                    {
                        continue;
                    }

                    var declarationRange  = declaration.GetDocumentRange();
                    var textControlOffset = textControl.Caret.DocumentOffset();
                    if (!declarationRange.Contains(textControlOffset))
                    {
                        continue;
                    }

                    var popupWindowContextSource = solution.GetComponent <IMainWindowPopupWindowContext>().Source;
                    return(sourceFile.Navigate(
                               textControl.Selection.OneDocRangeWithCaret(),
                               transferFocus,
                               tabOptions,
                               popupWindowContextSource));
                }
            }

            return(base.Navigate(solution, windowContext, transferFocus, tabOptions));
        }