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