Ejemplo n.º 1
0
        public void CQAndElement_GetCaml_ReturnsCorrectCaml()
        {
            const string val = "val";
            const string val2 = "val2";

            Expected =
                string.Format(
                    "<And><Neq><FieldRef ID='{0}' /><Value Type='Text'>{1}</Value></Neq><Eq><FieldRef ID='{0}' /><Value Type='Text'>{2}</Value></Eq></And>",
                    FieldId, val, val2);

            var left = new CQNeqElement();
            left.FieldRef(FieldId).Value(val);

            var right = new CQEqElement();
            right.FieldRef(FieldId).Value(val2);

            var element = new CQAndElement(left, right);

            Assert.That(element.GetCaml(), Is.EqualTo(Expected));
        }
Ejemplo n.º 2
0
        public void CQEqElement_GetCaml_ReturnsCorrectCaml()
        {
            const string op = "Eq";
            const string val = "val";
            Expected = string.Format("<{0}><FieldRef ID='{1}' /><Value Type='Text'>{2}</Value></{0}>", op, FieldId, val);

            var element = new CQEqElement();
            element.FieldRef(FieldId).Value(val);

            Assert.That(element.GetCaml(), Is.EqualTo(Expected));
        }