SonarLint.VisualStudio.Integration.ProfileConflicts.ConflictsManager.GetCurrentConflicts C# (CSharp) Method

GetCurrentConflicts() public method

public GetCurrentConflicts ( ) : IReadOnlyList
return IReadOnlyList
        public IReadOnlyList<ProjectRuleSetConflict> GetCurrentConflicts()
        {
            // Note: some of the assumptions (see asserts below) are because have just bounded the solution (as documented on the interface),
            // in other cases assuming that the rule set are indeed on disk is not possible, and in fact re-syncing
            // would be required when we have missing rule-sets, otherwise finding conflicts will not be possible.

            RuleSetInformation[] aggregatedRuleSets = GetAggregatedSolutionRuleSets();

            if (aggregatedRuleSets.Length > 0)
            {
                return FindConflicts(aggregatedRuleSets);
            }

            return new ProjectRuleSetConflict[0];
        }

Usage Example

        public void ConflictsManager_GetCurrentConflicts_NotBound()
        {
            // Setup
            var testSubject = new ConflictsManager(this.serviceProvider);
            this.SetValidProjects();
            this.solutionBinding.CurrentBinding = null;

            // Act + Verify
            Assert.AreEqual(0, testSubject.GetCurrentConflicts().Count, "Not expecting any conflicts since solution is not bound");
            this.outputWindowPane.AssertOutputStrings(0);
        }
All Usage Examples Of SonarLint.VisualStudio.Integration.ProfileConflicts.ConflictsManager::GetCurrentConflicts