internal static IEnumerable <T> CreateQueryResponse <T>(DataServiceContext context, Dictionary <string, string> headers, DataServiceQuery query, string xml) { var reader = ProjectionTests.ToXml(xml); object materializeAtom = ProjectionTests.CreateTestMaterializeAtomEnumerable(context, xml, query); Type queryType = typeof(DataServiceContext).Assembly.GetTypes().First(t => t.IsGenericType && t.Name.Contains("QueryOperationResponse")); queryType = queryType.MakeGenericType(typeof(T)); ConstructorInfo ctor = queryType.GetConstructors(BindingFlags.NonPublic | BindingFlags.Instance).Single(); object queryOperationResponse = ctor.Invoke(new object[] { CreateHeaderCollection(headers), query, materializeAtom }); return((IEnumerable <T>)queryOperationResponse); }
internal void AssertLinkCount(int expectedCount, string description) { ProjectionTests.AssertLinkCountForContext(expectedCount, description, this.context); }
private IEnumerable <T> CreateTestMaterializeAtom <T>( string text, IQueryable <T> query) { return(ProjectionTests.CreateTestMaterializeAtom(text, this.context, query)); }
private void AssertEntityCount(int expectedCount, string description) { ProjectionTests.AssertEntityCountForContext(expectedCount, description, this.context); }
private static string LinkEditMedia(string href, string etag) { return(ProjectionTests.LinkEditMedia(href, etag)); }
private static string LinkEdit(string href) { return(ProjectionTests.LinkEdit(href)); }
internal static string LinkFeed(string name, string content) { return(ProjectionTests.Link(false, name, content)); }
internal static string LinkEntry(string name, string content) { return(ProjectionTests.Link(true, name, content)); }