Esempio n. 1
0
        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)));
        }
Esempio n. 2
0
        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));
        }