public void SerializeCriterium() { var crit = new Criterium { ParamName = "paramX", Modifier = "modif1", Operand = new NumberValue(18), Type = Operator.GTE }; Assert.AreEqual("paramX:modif1=>=18", crit.ToString()); crit = new Criterium { ParamName = "paramX", Operand = new NumberValue(18) }; Assert.AreEqual("paramX=18", crit.ToString()); crit = new Criterium { ParamName = "paramX",Type = Operator.ISNULL }; Assert.AreEqual("paramX:missing=true", crit.ToString()); crit = new Criterium { ParamName = "paramX", Type = Operator.NOTNULL }; Assert.AreEqual("paramX:missing=false", crit.ToString()); }
public void SerializeChain() { var crit = new Criterium { ParamName = "par1", Modifier = "type1", Type = Operator.CHAIN, Operand = new Criterium { ParamName = "par2", Type = Operator.CHAIN, Operand = new Criterium { ParamName = "par3", Modifier = "text", Type = Operator.EQ, Operand = new StringValue("hoi") } } }; Assert.AreEqual("par1:type1.par2.par3:text=hoi", crit.ToString()); }