public bool Next()
{
var result = (_currentTimes = TriedTimes + 1) > _trueAfterTimes;
if (!result && _throwsException)
{
if (RandomExceptionType && TriedTimes % 2 == 0)
{
Console.WriteLine("Throwing InvalidOperationException");
throw new InvalidOperationException();
}
else
{
Console.WriteLine("Throwing ApplicationException");
throw new ApplicationException();
}
}
return result;
}