Beispiel #1
0
 private static void AddEmptyCall(IHttpConnection httpConnection, int startOffset)
 {
     httpConnection
     .FilterAsync <TestModel>(
         Arg.Any <Uri>(),
         Arg.Is <Dictionary <string, object> >(o => (int)o["offset"] > startOffset))
     .Returns(Task.FromResult(new CollectionResult <TestModel>
     {
         Results = Array.Empty <TestModel>()
     }));
 }
Beispiel #2
0
 private static void AddCall(IHttpConnection httpConnection, int offset, int count)
 {
     httpConnection
     .FilterAsync <TestModel>(
         Arg.Any <Uri>(),
         Arg.Is <Dictionary <string, object> >(o => o["offset"].Equals(offset)))
     .Returns(Task.FromResult(new CollectionResult <TestModel>
     {
         Results = Enumerable.Range(offset + 1, count)
                   .Select(i => new TestModel {
             Id = i
         })
                   .ToArray()
     }));
 }