Example #1
0
        public void TestAdd()
        {
            IStackSet <IScheduleNode> stackSet   = new StackSet <IScheduleNode>();
            IScheduleNode             testNumber = new DummyNode(1);

            stackSet.Push(testNumber);
            stackSet.Push(testNumber);
            Assert.True(stackSet.Count().Equals(1), "Set contains a duplicate.");
            Assert.True(stackSet.PopAny().Equals(new DummyNode(new Id(1))),
                        "Value was not correctly added.");
        }
Example #2
0
        public void TestPopAny()
        {
            IStackSet <IScheduleNode> stackSet    = new StackSet <IScheduleNode>();
            IScheduleNode             testNumber  = new DummyNode(1);
            IScheduleNode             testNumber2 = new DummyNode(5);

            stackSet.Push(testNumber);
            stackSet.Push(testNumber2);
            IScheduleNode poppedElement = stackSet.PopAny();

            Assert.True(
                (poppedElement.Equals(testNumber2) || poppedElement.Equals(testNumber)) &&
                stackSet.Count() == 1, "PopAny didn't work.");
        }