Ejemplo n.º 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);
        }
Ejemplo n.º 2
0
 internal void AssertLinkCount(int expectedCount, string description)
 {
     ProjectionTests.AssertLinkCountForContext(expectedCount, description, this.context);
 }
Ejemplo n.º 3
0
 private IEnumerable <T> CreateTestMaterializeAtom <T>(
     string text,
     IQueryable <T> query)
 {
     return(ProjectionTests.CreateTestMaterializeAtom(text, this.context, query));
 }
Ejemplo n.º 4
0
 private void AssertEntityCount(int expectedCount, string description)
 {
     ProjectionTests.AssertEntityCountForContext(expectedCount, description, this.context);
 }
Ejemplo n.º 5
0
 private static string LinkEditMedia(string href, string etag)
 {
     return(ProjectionTests.LinkEditMedia(href, etag));
 }
Ejemplo n.º 6
0
 private static string LinkEdit(string href)
 {
     return(ProjectionTests.LinkEdit(href));
 }
Ejemplo n.º 7
0
 internal static string LinkFeed(string name, string content)
 {
     return(ProjectionTests.Link(false, name, content));
 }
Ejemplo n.º 8
0
 internal static string LinkEntry(string name, string content)
 {
     return(ProjectionTests.Link(true, name, content));
 }