private static void RunHandler( TimeSpan interval, TimeSpan timeout, TimeSpan period, TimeSpan frequency) { var receiver = new Receiver(); var generator = new EventGenerator <ReportEvent>( frequency, () => DataGenerator.GenetationReportEvent(timeout)); void receiveData(ReportEvent[] data) => receiver.Receive(data); var dictionary = new QueueByTime <ReportEvent>(timeout, interval); dictionary.PulledData += receiveData; void addData(ReportEvent data) => dictionary.Push(data.Time, data); generator.Generated += addData; generator.Start(); Task.Delay(period).Wait(); generator.Stop(); dictionary.PulledData -= receiveData; generator.Generated -= addData; }
public void ExceptionAddTimeLargerCurrent() { void addTimeLargerCurrent() => _queue.Push(CurrentTime.AddMinutes(1), "A"); Assert.ThrowsException <ArgumentException>(addTimeLargerCurrent); }