Beispiel #1
0
        /// <summary>
        ///GetLength 的测试
        ///</summary>
        public void GetLengthTestHelper <T>()
        {
            LinkQueue <T> target = new LinkQueue <T>(); // TODO: 初始化为适当的值

            Assert.AreEqual(0, target.GetLength());

            target.In(default(T));
            Assert.AreEqual(1, target.GetLength());

            target.In(default(T));
            Assert.AreEqual(2, target.GetLength());
        }
Beispiel #2
0
        /// <summary>
        ///LinkQueue`1 构造函数 的测试
        ///</summary>
        public void LinkQueueConstructorTestHelper <T>()
        {
            LinkQueue <T> target = new LinkQueue <T>();

            Assert.IsNull(target.Front);

            Assert.IsNull(target.Rear);

            Assert.AreEqual(0, target.GetLength());
        }
Beispiel #3
0
        /// <summary>
        ///Clear 的测试
        ///</summary>
        public void ClearTestHelper <T>()
        {
            LinkQueue <T> target = new LinkQueue <T>(); // TODO: 初始化为适当的值

            target.In(default(T));

            target.In(default(T));

            Assert.IsNotNull(target.Front);
            Assert.IsNotNull(target.Rear);


            target.Clear();
            Assert.IsNull(target.Front);
            Assert.IsNull(target.Rear);
            Assert.AreEqual(0, target.GetLength());
        }