public SetEvaluator(oval_system_characteristics systemCharacteristics, IEnumerable<StateType> states, VariablesEvaluated variables) { this.systemCharacteristics = systemCharacteristics; this.ovalDefinitionStates = states; this.variables = variables; this.filterEvaluator = new FilterEvaluator(this.systemCharacteristics, this.ovalDefinitionStates, this.variables); }
public void Must_not_apply_filter_for_objectTypes_that_not_match_with_state_specification_of_filter() { string[] idsOfObjectTypes = new string[] { "oval:org.mitre.oval:obj:2000", "oval:org.mitre.oval:obj:3000" }; IEnumerable<sc.ObjectType> objectTypes = this.GetObjectTypesForTest(idsOfObjectTypes, systemCharacteristics); FilterEvaluator filterEvaluator = new FilterEvaluator(systemCharacteristics, states,null); IEnumerable<sc.ObjectType> objectTypesAfterFilter = filterEvaluator.ApplyFilter(objectTypes, "oval:org.mitre.oval:ste:99"); Assert.IsNotNull(objectTypesAfterFilter); Assert.AreEqual(2, objectTypesAfterFilter.Count(), "the quantity of objects is not expected"); }
public void Should_be_possible_to_apply_a_filter_in_ObjectTypeList_based_on_state() { string[] idsOfObjectTypes = new string[] { "oval:org.mitre.oval:obj:2000","oval:org.mitre.oval:obj:5000" }; IEnumerable<sc.ObjectType> objectTypes = this.GetObjectTypesForTest(idsOfObjectTypes, systemCharacteristics); FilterEvaluator filterEvaluator = new FilterEvaluator(systemCharacteristics,states,null); IEnumerable<sc.ObjectType> objectTypesAfterFilter = filterEvaluator.ApplyFilter(objectTypes, "oval:org.mitre.oval:ste:99"); Assert.IsNotNull(objectTypesAfterFilter); Assert.AreEqual(1,objectTypesAfterFilter.Count(),"the quantity of objects is not expected"); }