public async Task CreateSpoolerWithTasks_GivesValidBookMark() { Spooler <int, int, Tuple <int, string> > spooler = await Spooler <int, int, Tuple <int, string> > .StartNewAsync(_stateManager, _requests.ToArray(), Double, ResultConvertor); var bookmark = spooler.GetBookmark(); Assert.NotNull(bookmark); Assert.Equal(11, bookmark.TotalCount); }
public async Task CreateSpoolerFromBookmark_GivesResults() { Spooler <int, int, Tuple <int, string> > spooler = await Spooler <int, int, Tuple <int, string> > .StartNewAsync(_stateManager, _requests.ToArray(), Double, ResultConvertor); var bookmark = spooler.GetBookmark(); var newSpooler = bookmark.CreateSpooler <int, int, Tuple <int, string> >(_stateManager, 2); var results = new List <string>(); SpoolerResults <Tuple <int, string> > result; do { result = await newSpooler.GetResultsAsync(bookmark); bookmark = result.Bookmark; results.AddRange(result.Results.Select(x => x.Item2)); } while (result.MoreResultsAvailable); Assert.Equal(11, results.Count); }