Esempio n. 1
0
 public void Queue_MultipleItemsStored(IQueueable <int> queue)
 {
     queue.Enqueue(42);
     queue.Enqueue(37);
     queue.Enqueue(100500);
     Assert.Equal(42, queue.Dequeue());
     Assert.Equal(37, queue.Dequeue());
     Assert.Equal(100500, queue.Dequeue());
 }
Esempio n. 2
0
 public void Queue_DeletedFromEmpty_ShouldThrowInvalidOperation(IQueueable <int> queue)
 {
     Assert.Throws(typeof(InvalidOperationException), () =>
     {
         queue.Dequeue();
     });
 }
Esempio n. 3
0
 public void Queue_CountIsProperlyChanged(IQueueable <int> queue)
 {
     queue.Enqueue(42);
     queue.Enqueue(37);
     queue.Enqueue(queue.Dequeue());
     Assert.Equal(2, queue.Count);
 }
Esempio n. 4
0
 public void Queue_DeletedFromEmpty_ShouldThrowInvalidOperation(IQueueable<int> queue)
 {
     Assert.Throws(typeof(InvalidOperationException), () =>
     {
         queue.Dequeue();
     });
 }
Esempio n. 5
0
 public void Queue_CountIsProperlyChanged(IQueueable<int> queue)
 {
     queue.Enqueue(42);
     queue.Enqueue(37);
     queue.Enqueue(queue.Dequeue());
     Assert.Equal(2, queue.Count);
 }
Esempio n. 6
0
        public void Queue_PeekedAndDequeuedAreEqual(IQueueable <int> queue)
        {
            queue.Enqueue(42);
            queue.Enqueue(37);
            queue.Enqueue(100500);
            var temp = queue.Peek();

            Assert.Equal(temp, queue.Dequeue());
        }
Esempio n. 7
0
 public void StartListening()
 {
     while (true)
     {
         DataMessage msg = _DataFeed.Dequeue();
         //Use data
         DataHandler.LogEvent("Processed");
     }
 }
Esempio n. 8
0
 public void Queue_EnqueuedDequeued(IQueueable <int> queue)
 {
     queue.Enqueue(42);
     Assert.Equal(42, queue.Dequeue());
 }
Esempio n. 9
0
 public void Queue_PeekedAndDequeuedAreEqual(IQueueable<int> queue)
 {
     queue.Enqueue(42);
     queue.Enqueue(37);
     queue.Enqueue(100500);
     var temp = queue.Peek();
     Assert.Equal(temp, queue.Dequeue());
 }
Esempio n. 10
0
 public void Queue_MultipleItemsStored(IQueueable<int> queue)
 {
     queue.Enqueue(42);
     queue.Enqueue(37);
     queue.Enqueue(100500);
     Assert.Equal(42, queue.Dequeue());
     Assert.Equal(37, queue.Dequeue());
     Assert.Equal(100500, queue.Dequeue());
 }
Esempio n. 11
0
 public void Queue_EnqueuedDequeued(IQueueable<int> queue)
 {
     queue.Enqueue(42);
     Assert.Equal(42, queue.Dequeue());
 }