I have an async method lik this:
public async IAsyncEnumerable<IEnumerable<Foo>> Load()
{
//some times throws exception in this line
var responseEnumerable = _crawler.Crawl();
await foreach (var response in responseEnumerable)
{
yield return SomWorks(responseObject);
}
}
Now I want to test this method throws exception. How can I do this using xUnit
or FluentAssertion and xUnit
?