Example #1
0
        public void QueueTest_當存入輸入時_IsEmpty為false()
        {
            var expect = new int[] { 24, 12, 16, 22 };

            var queue = new Concept.Queue <int>();

            foreach (var i in expect)
            {
                queue.Enqueue(i);
            }

            Assert.IsFalse(queue.IsEmpty);
        }
Example #2
0
        private void CompareMatch <T>(IEnumerable <T> expect)
        {
            var queue = new Concept.Queue <T>();

            foreach (var i in expect)
            {
                queue.Enqueue(i);
            }

            var actual = new List <T>();

            while (!queue.IsEmpty)
            {
                var i = queue.Dequeue();
                actual.Add(i);
            }

            expect.ToExpectedObject().ShouldMatch(actual);
        }