public void ThrottledMetthodIsCalledOnFlush() { // arrange throttled = new Throttler<int>(Reseter, 100, TimeSpan.FromMinutes(5)); // test throttled.Call(new int()); throttled.Call(new int()); throttled.Call(new int()); throttled.Call(new List<int>()); throttled.Flush(); // assert Assert.IsTrue(waiter.WaitOne(2000)); Assert.IsTrue(length == 3); }
public void ThrottledMetthodIsNotCalledOnEmptyQueue() { // arrange throttled = new Throttler<int>(Reseter, 100, TimeSpan.FromMinutes(5)); // test throttled.Flush(); // assert Assert.IsFalse(waiter.WaitOne(2000)); }