private List <LocalVariableComponent> GetLocalVariableComponentList(oval_system_characteristics systemCharacteristics) { var components = new List <LocalVariableComponent>(); var literalComponent = new LiteralComponentType() { Value = @"\" }; var objectComponent1 = new ObjectComponentType() { object_ref = "oval:org.mitre.oval:obj:5000", item_field = "name" }; var objectComponent2 = new ObjectComponentType() { object_ref = "oval:org.mitre.oval:obj:6000", item_field = "name" }; var objectComponentEvaluator1 = new LocalVariableObjectComponent(objectComponent1, systemCharacteristics); var literalComponentEvaluator = new LocalVariableLiteralComponent(literalComponent); var objectComponentEvaluator2 = new LocalVariableObjectComponent(objectComponent2, systemCharacteristics); components.Add(objectComponentEvaluator1); components.Add(literalComponentEvaluator); components.Add(objectComponentEvaluator2); return(components); }
public OvalSubstringBuilder AddLiteralComponent(string value) { LiteralComponentType literalComponent = new LiteralComponentType() { Value = value, datatype = SimpleDatatypeEnumeration.@string }; this.substringFunction.Item = literalComponent; return(this); }
public OvalArithmeticBuilder AddLiteralComponent(string value, SimpleDatatypeEnumeration type) { LiteralComponentType literalComponent = new LiteralComponentType() { Value = value, datatype = type }; items.Add(literalComponent); return(this); }
public OvalEndBuilder AddLiteralComponent(string value) { LiteralComponentType literalComponent = new LiteralComponentType() { Value = value }; endFunciton.Item = literalComponent; return(this); }
public OvalBeginBuilder AddLiteralComponent(string value) { LiteralComponentType literalComponent = new LiteralComponentType() { Value = value }; beginFunction.Item = literalComponent; return(this); }
public OvalSplitBuilder AddLiteralComponent(string value) { LiteralComponentType literalComponentType = new LiteralComponentType() { Value = value, datatype = SimpleDatatypeEnumeration.@string }; splitFunctionType.Item = literalComponentType; return(this); }
public OvalEscapeRegexBuilder AddLiteralComponent(string value) { LiteralComponentType literalComponent = new LiteralComponentType() { Value = value }; this.escapeRegexFunction.Item = literalComponent; return(this); }
public OvalCountBuilder AddLiteralComponent(string value) { LiteralComponentType literalComponent = new LiteralComponentType() { Value = value }; this.items.Add(literalComponent); return(this); }
public void Should_be_possible_to_get_value_of_an_LiteralComponentType() { oval_definitions definitions = new OvalDocumentLoader().GetFakeOvalDefinitions("definitionsWithLocalVariable.xml"); Assert.IsNotNull(definitions, "the definitions is null"); LiteralComponentType literalComponent = new LiteralComponentType() { datatype = Modulo.Collect.OVAL.Common.SimpleDatatypeEnumeration.@string, Value = @"\System32" }; LocalVariableLiteralComponent literalVariable = new LocalVariableLiteralComponent(literalComponent); IEnumerable <string> values = literalVariable.GetValue(); Assert.IsTrue(values.Count() > 0, "the quantity of values is not expected"); Assert.IsTrue(values.ElementAt(0) == @"\System32", "the value is not expected"); }
private VariablesTypeVariableLocal_variable GetLocalVariableForAddOperationWithLiteralComponentTypeInt() { LiteralComponentType literalComponent1 = new LiteralComponentType() { Value = 10.ToString(), datatype = SimpleDatatypeEnumeration.@int }; LiteralComponentType literalComponent2 = new LiteralComponentType() { Value = 10.ToString(), datatype = SimpleDatatypeEnumeration.@int }; ArithmeticFunctionType arithmeticFunctionType = new ArithmeticFunctionType() { arithmetic_operation = ArithmeticEnumeration.add, Items = new [] { literalComponent1, literalComponent2 } }; VariablesTypeVariableLocal_variable localVariable = new VariablesTypeVariableLocal_variable() { Item = arithmeticFunctionType }; return(localVariable); }
public LocalVariableLiteralComponent(LiteralComponentType literalComponent) { this.literalComponent = literalComponent; }
public LocalVariableLiteralComponent(LiteralComponentType literalComponent) { this.literalComponent = literalComponent; }