예제 #1
0
    public void CacheCleanup()
    {
        var asyncFixerProvider = new AsyncFixerProvider(logger);

        asyncFixerProvider.Cleanup();

        var asyncifyProvider = new AsyncifyProvider(logger);

        asyncifyProvider.Cleanup();

        var meziantouProvider = new MeziantouProvider(logger);

        meziantouProvider.Cleanup();

        var microsoftCodeAnalysisNetAnalyzersProvider = new MicrosoftCodeAnalysisNetAnalyzersProvider(logger);

        microsoftCodeAnalysisNetAnalyzersProvider.Cleanup();

        var microsoftCompilerErrorsProvider = new MicrosoftCompilerErrorsProvider(logger);

        microsoftCompilerErrorsProvider.Cleanup();

        var microsoftCodeAnalysisNetAnalyzersProviderUndocumented = new MicrosoftCompilerErrorsProviderUndocumented(logger);

        microsoftCodeAnalysisNetAnalyzersProviderUndocumented.Cleanup();

        var microsoftVisualStudioThreadingAnalyzersProvider = new MicrosoftVisualStudioThreadingAnalyzersProvider(logger);

        microsoftVisualStudioThreadingAnalyzersProvider.Cleanup();

        var nSubstituteAnalyzersProvider = new NSubstituteAnalyzersProvider(logger);

        nSubstituteAnalyzersProvider.Cleanup();

        var securityCodeScanVs2019Provider = new SecurityCodeScanVs2019Provider(logger);

        securityCodeScanVs2019Provider.Cleanup();

        var styleCopAnalyzersProvider = new StyleCopAnalyzersProvider(logger);

        styleCopAnalyzersProvider.Cleanup();

        var sonarAnalyzerCSharpProvider = new SonarAnalyzerCSharpProvider(logger);

        sonarAnalyzerCSharpProvider.Cleanup();

        var wpfAnalyzersProvider = new WpfAnalyzersProvider(logger);

        wpfAnalyzersProvider.Cleanup();

        var xunitProvider = new XunitProvider(logger);

        xunitProvider.Cleanup();
    }
    public async Task CollectBaseRules(ProviderCollectingMode providerCollectingMode)
    {
        // Arrange
        var provider = new StyleCopAnalyzersProvider(NullLogger.Instance);

        // Act
        var actual = await provider.CollectBaseRules(providerCollectingMode);

        // Assert
        Assert.NotNull(actual);
        Assert.NotNull(actual.Name);
        Assert.Equal(StyleCopAnalyzersProvider.Name, actual.Name);
        Assert.NotNull(actual.Rules);
        Assert.True(actual.Rules.Count >= 198);
    }
예제 #3
0
    public async Task <Collection <AnalyzerProviderBaseRuleData> > CollectAllBaseRules(
        ProviderCollectingMode providerCollectingMode,
        bool logWithAnsiConsoleMarkup)
    {
        var data = new Collection <AnalyzerProviderBaseRuleData>();

        var asyncFixerProvider = new AsyncFixerProvider(logger, logWithAnsiConsoleMarkup);
        var asyncFixerTask     = asyncFixerProvider.CollectBaseRules(providerCollectingMode);

        var asyncifyProvider = new AsyncifyProvider(logger, logWithAnsiConsoleMarkup);
        var asyncifyTask     = asyncifyProvider.CollectBaseRules(providerCollectingMode);

        var meziantouProvider = new MeziantouProvider(logger, logWithAnsiConsoleMarkup);
        var meziantouTask     = meziantouProvider.CollectBaseRules(providerCollectingMode);

        var microsoftCodeAnalysisNetAnalyzersProvider = new MicrosoftCodeAnalysisNetAnalyzersProvider(logger, logWithAnsiConsoleMarkup);
        var microsoftCodeAnalysisNetAnalyzersTask     = microsoftCodeAnalysisNetAnalyzersProvider.CollectBaseRules(providerCollectingMode);

        var microsoftCompilerErrorsProvider = new MicrosoftCompilerErrorsProvider(logger, logWithAnsiConsoleMarkup);
        var microsoftCompilerErrorsTask     = microsoftCompilerErrorsProvider.CollectBaseRules(providerCollectingMode);

        var microsoftCodeAnalysisNetAnalyzersProviderUndocumented = new MicrosoftCompilerErrorsProviderUndocumented(logger, logWithAnsiConsoleMarkup);
        var microsoftCompilerErrorsUndocumentedTask = microsoftCodeAnalysisNetAnalyzersProviderUndocumented.CollectBaseRules(ProviderCollectingMode.ReCollect);

        var microsoftVisualStudioThreadingAnalyzersProvider     = new MicrosoftVisualStudioThreadingAnalyzersProvider(logger, logWithAnsiConsoleMarkup);
        var microsoftVisualStudioThreadingAnalyzersProviderTask = microsoftVisualStudioThreadingAnalyzersProvider.CollectBaseRules(ProviderCollectingMode.ReCollect);

        var nSubstituteAnalyzersProvider     = new NSubstituteAnalyzersProvider(logger, logWithAnsiConsoleMarkup);
        var nSubstituteAnalyzersProviderTask = nSubstituteAnalyzersProvider.CollectBaseRules(ProviderCollectingMode.ReCollect);

        var securityCodeScanVs2019Provider = new SecurityCodeScanVs2019Provider(logger, logWithAnsiConsoleMarkup);
        var securityCodeScanVs2019Task     = securityCodeScanVs2019Provider.CollectBaseRules(providerCollectingMode);

        var styleCopAnalyzersProvider = new StyleCopAnalyzersProvider(logger, logWithAnsiConsoleMarkup);
        var styleCopAnalyzersTask     = styleCopAnalyzersProvider.CollectBaseRules(providerCollectingMode);

        var sonarAnalyzerCSharpProvider = new SonarAnalyzerCSharpProvider(logger, logWithAnsiConsoleMarkup);
        var sonarAnalyzerCSharpTask     = sonarAnalyzerCSharpProvider.CollectBaseRules(providerCollectingMode);

        var wpfAnalyzersProvider     = new WpfAnalyzersProvider(logger, logWithAnsiConsoleMarkup);
        var wpfAnalyzersProviderTask = wpfAnalyzersProvider.CollectBaseRules(providerCollectingMode);

        var xunitProvider     = new XunitProvider(logger, logWithAnsiConsoleMarkup);
        var xunitProviderTask = xunitProvider.CollectBaseRules(providerCollectingMode);

        await Task.WhenAll(
            asyncFixerTask,
            asyncifyTask,
            meziantouTask,
            microsoftCodeAnalysisNetAnalyzersTask,
            microsoftCompilerErrorsTask,
            microsoftCompilerErrorsUndocumentedTask,
            microsoftVisualStudioThreadingAnalyzersProviderTask,
            nSubstituteAnalyzersProviderTask,
            securityCodeScanVs2019Task,
            styleCopAnalyzersTask,
            sonarAnalyzerCSharpTask,
            wpfAnalyzersProviderTask,
            xunitProviderTask);

        data.Add(await asyncFixerTask);
        data.Add(await asyncifyTask);
        data.Add(await meziantouTask);
        data.Add(await microsoftCodeAnalysisNetAnalyzersTask);
        data.Add(await microsoftCompilerErrorsTask);
        data.Add(await microsoftCompilerErrorsUndocumentedTask);
        data.Add(await microsoftVisualStudioThreadingAnalyzersProviderTask);
        data.Add(await nSubstituteAnalyzersProviderTask);
        data.Add(await securityCodeScanVs2019Task);
        data.Add(await styleCopAnalyzersTask);
        data.Add(await sonarAnalyzerCSharpTask);
        data.Add(await wpfAnalyzersProviderTask);
        data.Add(await xunitProviderTask);

        return(data);
    }