Exemple #1
0
        public void Should_be_possible_to_analyse_a_definition_which_on_state_has_external_variable_reference()
        {
            var variableFactory = new ExternalVariableFactory("modulo-Exchange2003-oval.xml");
            var fakeVariableValues = new Dictionary<string, string[]>();
            fakeVariableValues.Add("oval:com.modulo.exchange2003:var:1304801", new[] { "False" });
            fakeVariableValues.Add("oval:com.modulo.exchange2003:var:1304802", new[] { "True" });
            var externalVariables = variableFactory.CreateOvalVariablesDocument(fakeVariableValues);
            var ovalResultsSample =
                GetOvalResultsFromDefinitionsAndSystemCharacteristicsDocuments(
                    "modulo-Exchange2003-oval.xml", "modulo-Exchange2003-sc.xml", externalVariables);

            ovalResultsSample.Analyze();

            var allDefinitions = ovalResultsSample.results[0].definitions;
            var definitionMustBeTrue = allDefinitions.Single(def => def.definition_id == "oval:com.modulo.exchange2003:def:13048001");
            Assert.AreEqual(ResultEnumeration.@true, definitionMustBeTrue.result);
            var definitionMustBeFalse = allDefinitions.Single(def => def.definition_id == "oval:com.modulo.exchange2003:def:13048002");
            Assert.AreEqual(ResultEnumeration.@false, definitionMustBeFalse.result);
        }
 public ExternalVariableValidatorTest()
 {
     this.ExternalVariableFactory = new ExternalVariableFactory("fdcc_xpfirewall_oval.xml");
     this.Validator = new ExternalVariableValidator();
 }
 public External_variableTest()
 {
     this.ExternalVariableFactory = new ExternalVariableFactory("fdcc_xpfirewall_oval.xml");
 }