using Microsoft.VisualStudio.TestTools.UnitTesting; namespace HeuristicLab.SimulationCore.Tests { /// /// Summary description for FibonacciHeapTest /// [TestClass] public class EventQueueTest { private class DummyAction : IAction { public System.Guid ActionId { get { throw new System.NotImplementedException(); } } public IActivity Mandate { get { throw new System.NotImplementedException(); } } public void Execute(IModel model) { throw new System.NotImplementedException(); } public Common.IDeepCloneable Clone(Common.Cloner cloner) { throw new System.NotImplementedException(); } public object Clone() { throw new System.NotImplementedException(); } } [TestMethod] public void EventQueueCreateTest() { var queue = new SortedListEventQueue(); queue.Push(new Event(5, new DummyAction())); Assert.IsTrue(queue.Count == 1); queue.Push(new Event(2, new DummyAction())); Assert.IsTrue(queue.Peek().Time == 2); Assert.IsTrue(queue.Count == 2); queue.Push(new Event(3, new DummyAction())); Assert.IsTrue(queue.Peek().Time == 2); Assert.IsTrue(queue.Count == 3); for (var i = 10; i < 50; i++) queue.Push(new Event(i, new DummyAction())); Assert.IsTrue(queue.Peek().Time == 2); Assert.IsTrue(queue.Count == 43); queue.Push(new Event(2, new DummyAction())); } } }