Skip to content

Instantly share code, notes, and snippets.

@masaab
Created April 15, 2020 05:27
Show Gist options
  • Select an option

  • Save masaab/0c745055db2e0b0ae00188ae55e17e25 to your computer and use it in GitHub Desktop.

Select an option

Save masaab/0c745055db2e0b0ae00188ae55e17e25 to your computer and use it in GitHub Desktop.
return mocked item for IAyncEnumerable using AutoFixture
public async IAsyncEnumerable<ScheduledJob> GetXNumberofScheduledJobs(int totalNumberofScheduledJob)
{
AutoFixture = new Fixture();
IEnumerator<ScheduledJob> enumerator = AutoFixture.CreateMany<ScheduledJob>(5).GetEnumerator();
while (enumerator.MoveNext())
{
yield return enumerator.Current;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment