示例#1
0
        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);
 }
示例#3
0
 private IEnumerable <T> CreateTestMaterializeAtom <T>(
     string text,
     IQueryable <T> query)
 {
     return(ProjectionTests.CreateTestMaterializeAtom(text, this.context, query));
 }
示例#4
0
 private void AssertEntityCount(int expectedCount, string description)
 {
     ProjectionTests.AssertEntityCountForContext(expectedCount, description, this.context);
 }
示例#5
0
 private static string LinkEditMedia(string href, string etag)
 {
     return(ProjectionTests.LinkEditMedia(href, etag));
 }
示例#6
0
 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));
 }