Ejemplo n.º 1
0
        public void AllRulesHaveDescription()
        {
            var analyzer = new LinterAnalyzer(configuration);
            var ruleSet  = analyzer.GetRuleSet();

            ruleSet.Should().OnlyContain(r => r.Description.Length > 0);
        }
Ejemplo n.º 2
0
        private (IBicepAnalyzerRule[] rules, JObject configSchema) GetRulesAndSchema()
        {
            var linter  = new LinterAnalyzer(BicepTestConstants.BuiltInConfiguration);
            var ruleSet = linter.GetRuleSet();

            ruleSet.Should().NotBeEmpty();

            var configStream = typeof(BicepConfigSchemaTests).Assembly.GetManifestResourceStream(
                $"{typeof(BicepConfigSchemaTests).Assembly.GetName().Name}.bicepconfig.schema.json");

            Assert.IsNotNull(configStream);
            var configContents = new StreamReader(configStream).ReadToEnd();

            Assert.IsNotNull(configContents);
            var configSchema = JObject.Parse(configContents);

            return(ruleSet.ToArray(), configSchema);
        }
Ejemplo n.º 3
0
        public void HasBuiltInRules()
        {
            var linter = new LinterAnalyzer();

            linter.GetRuleSet().Should().NotBeEmpty();
        }