public void Should_be_possible_to_create_a_systemCharacteristics_eliminating_duplicate_references_for_itemType_in_the_systemData_property() { SystemCharacteristicsFactory factory = new SystemCharacteristicsFactory(); ProbeResult probeResult = new ProbeResultFactory().CreateProbeResultForRegistryCollectWithSytemDataDuplicated(); oval_system_characteristics systemCharacteristics = factory.CreateSystemCharacteristics(probeResult); Assert.IsNotNull(systemCharacteristics, "the systemCharacteristics expected is null"); Assert.AreEqual(2, systemCharacteristics.system_data.Count(), "the quantity of system data is not expected"); }
public void Should_be_possible_to_create_system_characteristics_given_a_probeResult() { SystemCharacteristicsFactory factory = new SystemCharacteristicsFactory(); ProbeResult probe = new ProbeResultFactory().CreateProbeResultForRegistryCollect(); oval_system_characteristics systemCharacteristics = factory.CreateSystemCharacteristics(probe); Assert.IsNotNull(systemCharacteristics); Assert.IsNotNull(systemCharacteristics.collected_objects, "the collected object is null"); Assert.IsTrue(systemCharacteristics.collected_objects[0].id == ProbeResultFactory.ID_REGISTRY_OBJECT, "the oval id is not expected"); Assert.IsTrue(systemCharacteristics.collected_objects.Count() == 1); Assert.IsNotNull(systemCharacteristics.system_data, "the system data is null"); Assert.IsTrue(systemCharacteristics.system_data.Count() > 0, "the system data is empty."); Assert.IsNotNull(systemCharacteristics.generator, "the generator is null"); Assert.IsNotNull(systemCharacteristics.system_info, "the system info is not null."); Assert.IsTrue(systemCharacteristics.system_info.interfaces.Count() == 1, "the interfaces is not expected"); }
public void Should_be_possible_to_create_system_characteristics_given_a_probeResult_with_variables() { SystemCharacteristicsFactory factory = new SystemCharacteristicsFactory(); ProbeResult probe = new ProbeResultFactory().CreateProbeResultForRegistryCollectWithVariables(); oval_system_characteristics systemCharacteristics = factory.CreateSystemCharacteristics(probe); Assert.IsNotNull(systemCharacteristics); Assert.IsNotNull(systemCharacteristics.collected_objects, "the collected object is null"); Assert.IsTrue(systemCharacteristics.collected_objects[0].id == ProbeResultFactory.ID_REGISTRY_OBJECT, "the oval id is not expected"); Assert.AreEqual(systemCharacteristics.collected_objects[0].variable_value[0].variable_id, "oval:com.hp:var:4", "the variable Id is not expected"); Assert.AreEqual(systemCharacteristics.collected_objects[0].variable_value[0].Value, "Microsoft\\WindowsNT\\", "the variable value is not expected"); Assert.IsTrue(systemCharacteristics.collected_objects.Count() == 1); Assert.IsNotNull(systemCharacteristics.system_data, "the system data is null"); Assert.IsTrue(systemCharacteristics.system_data.Count() > 0, "the system data is empty."); Assert.IsNotNull(systemCharacteristics.generator, "the generator is null"); Assert.IsNotNull(systemCharacteristics.system_info, "the system info is not null."); Assert.IsTrue(systemCharacteristics.system_info.interfaces.Count() == 1, "the interfaces is not expected"); }