public RatesProviderMock( string name, int priority, InvokeCase invokeCase) { ActualInvokeCase = invokeCase; Name = name; Priority = priority; }
public async Task UpdateRates(CancellationToken ct) { if (invokeCases.TryDequeue(out InvokeCase currentCase)) { currentCase = new InvokeCase(); } InvokesCount++; await Task.Delay(currentCase.WorkTime, ct); if (currentCase.ThrowException) { throw new Exception(); } }