public async Task ModulesAreEnabledByDefault() { CSharpCompilation compilation = RoslynUtilities.CreateBaseCompilation(); DisabledModuleAnalyzer analyzer = new(); await analyzer.RunAnalyzer(compilation); Assert.True(ModuleIdentity.GetAllModules().AsEnums().All(module => DisabledModuleAnalyzer.IsEnabled(module))); }
public async Task DisablesModule_When_HasDisableModuleAttribute() { string input = "[assembly: Durian.DisableModule(Durian.Info.DurianModule.DefaultParam)]"; CSharpCompilation compilation = RoslynUtilities.CreateBaseCompilation(); compilation = compilation.AddSyntaxTrees(CSharpSyntaxTree.ParseText(input)); DisabledModuleAnalyzer analyzer = new(); await analyzer.RunAnalyzer(compilation); Assert.False(DisabledModuleAnalyzer.IsEnabled(DurianModule.DefaultParam)); }