public void test_THAT_1_join_ARE_translated_correctly() { string xml = "<Joins>" + "<Join Type=\"LEFT\" ListAlias=\"Customers\">" + "<Eq>" + "<FieldRef Name=\"CustomerName\" RefType=\"Id\" />" + "<FieldRef List=\"Customers\" Name=\"Id\" />" + "</Eq>" + "</Join>" + "</Joins>"; var b = new ReOperandBuilderFromCaml(); var t = new ReTranslatorFromCaml(null, null, null, null, new ReJoinAnalyzer(XmlHelper.Get(xml), b), null); var expr = t.TranslateJoins(); Assert.That(expr[0].Key.ToString(), Is.EqualTo("x => x.get_Item(\"CustomerName\").ForeignList(\"Customers\")")); Assert.That(expr[0].Value, Is.EqualTo(JoinType.Left)); }
public void test_THAT_view_fields_ARE_translated_correctly() { string xml = "<ViewFields>" + "<FieldRef Name=\"Title\" />" + "</ViewFields>"; var b = new ReOperandBuilderFromCaml(); var t = new ReTranslatorFromCaml(null, null, null, new ReArrayAnalyzer(XmlHelper.Get(xml), b), null, null); var expr = t.TranslateViewFields(); Assert.That(expr.ToString(), Is.EqualTo("x => x.get_Item(\"Title\")")); }