public void RunReadFeedTest(bool isFullValidation)
 {
     using (var messageReader = ODataMessageHelper.CreateMessageReader(_stream, Model, ODataMessageKind.Response, isFullValidation))
     {
         ODataReader feedReader = messageReader.CreateODataResourceSetReader(TestEntitySet, TestEntityType);
         while (feedReader.Read())
         {
         }
     }
 }
 /// <summary>
 /// Reads feed from stream
 /// </summary>
 /// <param name="readStream"></param>
 /// <param name="edmModel"></param>
 /// <param name="entitySet"></param>
 /// <param name="expectedBaseEntityType"></param>
 protected void ReadFeed(Stream readStream, IEdmModel edmModel, IEdmEntitySetBase entitySet, IEdmEntityType expectedBaseEntityType)
 {
     readStream.Seek(0, SeekOrigin.Begin);
     using (var messageReader = ODataMessageHelper.CreateMessageReader(readStream, edmModel))
     {
         ODataReader feedReader = messageReader.CreateODataFeedReader(entitySet, expectedBaseEntityType);
         while (feedReader.Read())
         {
         }
     }
 }
Exemple #3
0
 private void ReadFeedTestAndMeasure(string templateFile, int entryCount, bool isFullValidation)
 {
     foreach (var iteration in Benchmark.Iterations)
     {
         using (var stream = new MemoryStream(PayloadGenerator.GenerateFeed(templateFile, entryCount)))
         {
             using (iteration.StartMeasurement())
             {
                 using (var messageReader = ODataMessageHelper.CreateMessageReader(stream, Model, ODataMessageKind.Response, isFullValidation))
                 {
                     ODataReader feedReader = messageReader.CreateODataResourceSetReader(TestEntitySet, TestEntityType);
                     while (feedReader.Read())
                     {
                     }
                 }
             }
         }
     }
 }