Exemplo n.º 1
0
        private static TaintIssuesControlViewModel CreateTestSubject(
            IAnalysisIssueVisualization[] issueVizs = null,
            ILocationNavigator locationNavigator    = null,
            Mock <ITaintStore> store = null,
            IActiveDocumentTracker activeDocumentTracker = null,
            IActiveDocumentLocator activeDocumentLocator = null,
            ITelemetryManager telemetryManager           = null,
            IShowInBrowserService showInBrowserService   = null,
            IIssueSelectionService selectionService      = null)
        {
            issueVizs ??= Array.Empty <IAnalysisIssueVisualization>();
            store ??= new Mock <ITaintStore>();
            store.Setup(x => x.GetAll()).Returns(issueVizs);

            activeDocumentTracker ??= Mock.Of <IActiveDocumentTracker>();
            activeDocumentLocator ??= Mock.Of <IActiveDocumentLocator>();
            showInBrowserService ??= Mock.Of <IShowInBrowserService>();
            locationNavigator ??= Mock.Of <ILocationNavigator>();
            telemetryManager ??= Mock.Of <ITelemetryManager>();
            selectionService ??= Mock.Of <IIssueSelectionService>();

            return(new TaintIssuesControlViewModel(store.Object,
                                                   locationNavigator,
                                                   activeDocumentTracker,
                                                   activeDocumentLocator,
                                                   showInBrowserService,
                                                   telemetryManager,
                                                   selectionService));
        }
Exemplo n.º 2
0
 public NavigateToRuleDescriptionCommand(IShowInBrowserService showInBrowserService)
     : base(parameter =>
 {
     var ruleKey = (string)parameter;
     showInBrowserService.ShowRuleDescription(ruleKey);
 },
            parameter => parameter is string s && !string.IsNullOrEmpty(s))
Exemplo n.º 3
0
 public NavigateToDocumentationCommand(IShowInBrowserService showInBrowserService)
     : base(parameter => showInBrowserService.ShowDocumentation())
 {
 }
Exemplo n.º 4
0
 private NavigateToDocumentationCommand CreateTestSubject(IShowInBrowserService browserService = null)
 {
     return(new NavigateToDocumentationCommand(browserService));
 }
 private NavigateToRuleDescriptionCommand CreateTestSubject(IShowInBrowserService browserService = null)
 {
     return(new NavigateToRuleDescriptionCommand(browserService));
 }