public StartupAnalyzerContext(StartupAnalzyer analyzer, StartupSymbols startupSymbols)
        {
            _analyzer      = analyzer;
            StartupSymbols = startupSymbols;

            _analysesByType = new Dictionary <INamedTypeSymbol, List <object> >();
            _lock           = new object();
        }
        public StartupAnalyzerTest()
        {
            StartupAnalyzer = new StartupAnalzyer();
            StartupAnalyzer.StartupFilePredicate = path => path.Equals("Test.cs", StringComparison.Ordinal);

            Runner = new MvcDiagnosticAnalyzerRunner(StartupAnalyzer);

            Analyses = new ConcurrentBag <StartupComputedAnalysis>();
            ConfigureServicesMethods         = new ConcurrentBag <IMethodSymbol>();
            ConfigureMethods                 = new ConcurrentBag <IMethodSymbol>();
            StartupAnalyzer.AnalysisStarted += (sender, analysis) => Analyses.Add(analysis);
            StartupAnalyzer.ConfigureServicesMethodFound += (sender, method) => ConfigureServicesMethods.Add(method);
            StartupAnalyzer.ConfigureMethodFound         += (sender, method) => ConfigureMethods.Add(method);
        }
Example #3
0
        public StartupAnalyzerTest()
        {
            StartupAnalyzer = new StartupAnalzyer();

            Runner = new AnalyzersDiagnosticAnalyzerRunner(StartupAnalyzer);

            Analyses = new ConcurrentBag <object>();
            ConfigureServicesMethods = new ConcurrentBag <IMethodSymbol>();
            ConfigureMethods         = new ConcurrentBag <IMethodSymbol>();
            StartupAnalyzer.ServicesAnalysisCompleted    += (sender, analysis) => Analyses.Add(analysis);
            StartupAnalyzer.OptionsAnalysisCompleted     += (sender, analysis) => Analyses.Add(analysis);
            StartupAnalyzer.MiddlewareAnalysisCompleted  += (sender, analysis) => Analyses.Add(analysis);
            StartupAnalyzer.ConfigureServicesMethodFound += (sender, method) => ConfigureServicesMethods.Add(method);
            StartupAnalyzer.ConfigureMethodFound         += (sender, method) => ConfigureMethods.Add(method);
        }