public void Should_be_possible_to_generate_wmi57_item_to_collect_from_an_object_with_referenced_variable_in_namespace_entity() { var fakeObject = ProbeHelper.GetDefinitionObjectTypeByID("definitionsSimple.xml", "oval:modulo:obj:2202"); var fakeVariables = VariableHelper.CreateVariableWithOneValue("oval:modulo:obj:2202", "oval:modulo:var:2202", "root\\default"); var itemsToCollect = new Wmi57ItemTypeGenerator().GetItemsToCollect(fakeObject, fakeVariables).ToArray(); ItemTypeChecker.DoBasicAssertForItems(itemsToCollect, 1, typeof(wmi57_item)); var wmiItemType = (wmi57_item)itemsToCollect.Single(); ItemTypeEntityChecker.AssertItemTypeEntity(wmiItemType.@namespace, "root\\default"); ItemTypeEntityChecker.AssertItemTypeEntity(wmiItemType.wql, "select caption, name from Win32_OperatingSystem"); }
public void Should_be_possible_to_generate_wmi57_item_to_collect() { var fakeObject = ProbeHelper.GetDefinitionObjectTypeByID("definitionsSimple.xml", "oval:modulo:obj:2201"); var itemTypeGenerator = new Wmi57ItemTypeGenerator(); var itemsToCollect = itemTypeGenerator.GetItemsToCollect(fakeObject, null).ToArray(); ItemTypeChecker.DoBasicAssertForItems(itemsToCollect, 1, typeof(wmi57_item)); var wmiItemType = (wmi57_item)itemsToCollect.Single(); ItemTypeEntityChecker.AssertItemTypeEntity(wmiItemType.@namespace, "root\\cimv2"); ItemTypeEntityChecker.AssertItemTypeEntity(wmiItemType.wql, "select caption, name from Win32_OperatingSystem"); }
public void Should_be_possible_to_generate_wmi57_item_to_collect_from_an_object_with_referenced_variable_in_wql_entity() { var fakeObject = ProbeHelper.GetDefinitionObjectTypeByID("definitionsSimple.xml", "oval:modulo:obj:2203"); var fakeVariableValues = new Dictionary <string, IEnumerable <string> >(); fakeVariableValues.Add("oval:modulo:var:2202", new string[] { "root\\default", "root\\cimv2" }); fakeVariableValues.Add("oval:modulo:var:2203", new string[] { "Select domain, name From Win32_Account" }); var fakeVariables = VariableHelper.CreateEvaluatedVariables("oval:modulo:obj:2203", fakeVariableValues); var itemsToCollect = new Wmi57ItemTypeGenerator().GetItemsToCollect(fakeObject, fakeVariables).ToArray(); ItemTypeChecker.DoBasicAssertForItems(itemsToCollect, 2, typeof(wmi57_item)); ItemTypeEntityChecker.AssertItemTypeEntity(((wmi57_item)itemsToCollect[0]).@namespace, "root\\default"); ItemTypeEntityChecker.AssertItemTypeEntity(((wmi57_item)itemsToCollect[0]).wql, "Select domain, name From Win32_Account"); ItemTypeEntityChecker.AssertItemTypeEntity(((wmi57_item)itemsToCollect[1]).@namespace, "root\\cimv2"); ItemTypeEntityChecker.AssertItemTypeEntity(((wmi57_item)itemsToCollect[1]).wql, "Select domain, name From Win32_Account"); }