Пример #1
0
        public void PassesIssueSummaryToNewGroup()
        {
            nextProvider.Group = CreateSecondaryGroup();

            var probe = new IssueSummary();

            group.AddIssue(probe);
            Assert.IsTrue(((IIssueTreeNode)nextProvider.Group).Children.Contains(probe), "The issue was not added to the new group.");
        }
Пример #2
0
        public void PassesIssueSummaryToExistingGroup()
        {
            // "prime" the tree of groups
            nextProvider.Group = CreateSecondaryGroup();
            group.AddIssue(new IssueSummary());

            var probe = new IssueSummary();

            group.AddIssue(probe);
            Assert.IsTrue(((IIssueTreeNode)nextProvider.Group).Children.Contains(probe), "The issue was not added to the existing group.");
        }
Пример #3
0
 public void SetUp()
 {
     Provider = CreateProviderInstance();
     summary  = new IssueSummary {
         IssueDescription    = "IssueDescription",
         IssueMarker         = IssueMarker.None,
         ProviderCategory    = "ProviderCategory",
         ProviderDescription = "ProviderDescription",
         ProviderTitle       = "ProviderTitle",
         Region   = new DomRegion("fileName", new TextLocation(2, 3), new TextLocation(2, 10)),
         Severity = Severity.None
     };
 }
Пример #4
0
        public void LeavesFilteredCorrectly()
        {
            var            leafGroup = new IssueGroup(NullGroupingProvider.Instance, "sut");
            IIssueTreeNode leafNode  = leafGroup;
            var            issue     = new IssueSummary();

            leafGroup.AddIssue(issue);

            var children = leafNode.Children;

            Assert.That(children.Contains(issue));
            Assert.AreEqual(1, children.Count, "The group contained too many issues.");
        }
Пример #5
0
        public void NoEventsCalledForIssuesAddedBeforeProcessingEnabled()
        {
            var            localGroup = new IssueGroup(null, "sut");
            IIssueTreeNode localNode  = localGroup;

            localNode.ChildAdded += Forbidden <IssueTreeNodeEventArgs> ("node.ChildAdded");
            var issue = new IssueSummary();

            localGroup.AddIssue(issue);

            var children = localNode.Children;

            Assert.That(children.Contains(issue));
            Assert.AreEqual(1, children.Count, "The number of children was incorrect.");
        }
Пример #6
0
        public void PassesIssueSummaryToNewGroupDuringEnableProcessing()
        {
            var disabledGroup = new IssueGroup(nextProvider, "sut");

            // "prime" the tree of groups
            nextProvider.Group = CreateSecondaryGroup();

            var probe = new IssueSummary();

            disabledGroup.AddIssue(probe);
            disabledGroup.EnableProcessing();
            var issues = ((IIssueTreeNode)nextProvider.Group).Children;

            Assert.IsTrue(issues.Contains(probe), "The issue was not added to the new group.");
        }
 protected override string GetGroupName(IssueSummary issue)
 {
     return(issue.ProviderCategory);
 }
Пример #8
0
 public IssueGroup GetIssueGroup(IssueSummary issue)
 {
     GetIssueGroupCalled = true;
     return(Group);
 }
Пример #9
0
 protected override string GetGroupingKey(IssueSummary issue)
 {
     return(issue.ProviderTitle);
 }