public void WhereNav1() { var result = ClassWithLink.CreateQuery().OData().Filter("Link1/Id eq 211").ToArray(); Assert.Single((IEnumerable)result); Assert.Equal(21, result[0].Id); }
public void SelectLinkWithoutExpandNotWorking() { ISelectExpandWrapper[] result = ClassWithLink.CreateQuery().OData().SelectExpand("Link1").ToArray(); IDictionary <string, object> metadata = result[0].ToDictionary(); Assert.Equal(0, metadata.Count); }
public void EmptyExpandSelectAll() { ISelectExpandWrapper[] result = ClassWithLink.CreateQuery().OData().SelectExpand("*").ToArray(); IDictionary <string, object> metadata = result[0].ToDictionary(); // Not expanded by default except auto expand attribute Assert.Equal(2, metadata.Count); }
public void ExpandLinkSelect() { ISelectExpandWrapper[] result = ClassWithLink.CreateQuery().OData().SelectExpand("Name", "Link1($select=Name)").ToArray(); IDictionary <string, object> metadata = result[0].ToDictionary(); // Not expanded by default Assert.Equal(2, metadata.Count); Assert.Equal(1, (metadata["Link1"] as ISelectExpandWrapper).ToDictionary().Count); }
public void WhereNavThrowException() { Assert.Throws <ODataException>(() => ClassWithLink.CreateQuery().OData().Filter("Link2/Id eq 211")); }