private SimulateFailureNTimes ( uint timesToFail, bool throwExceptionOnFailure = true ) : object | ||
timesToFail | uint | |
throwExceptionOnFailure | bool | |
리턴 | object |
private object SimulateFailureNTimes(uint timesToFail, bool throwExceptionOnFailure = true)
{
this.iteration++;
if(this.iteration <= timesToFail)
{
if(throwExceptionOnFailure)
throw new Exception("Simulated count failure");
return null;
}
return DateTime.UtcNow;
}