Ejemplo n.º 1
0
 public RatesProviderMock(
     string name,
     int priority,
     InvokeCase invokeCase)
 {
     ActualInvokeCase = invokeCase;
     Name             = name;
     Priority         = priority;
 }
Ejemplo n.º 2
0
        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();
            }
        }