public void RemoveFromFront_WhenEmpty_IsRejected()
        {
            Deque <int> q = new Deque <int>();

            q.RemoveFromFront();
        }
Example #2
0
        public void NongenericSyncRoot_IsSelf()
        {
            var deque = new Deque <int>() as IList;

            Assert.Same(deque, deque.SyncRoot);
        }
        public void Capacity_LessThanCount_IsRejected()
        {
            Deque <int> q = new Deque <int>(new[] { 1, 2, 3, 4, 5 });

            q.Capacity = 4;
        }
Example #4
0
        public void NongenericIsFixedSize_IsFalse()
        {
            var deque = new Deque <int>() as IList;

            Assert.False(deque.IsFixedSize);
        }
Example #5
0
        public void NongenericIsSynchronized_IsFalse()
        {
            var deque = new Deque <int>() as IList;

            Assert.False(deque.IsSynchronized);
        }
Example #6
0
        public void NongenericContains_ItemNotPresent_ReturnsFalse()
        {
            var deque = new Deque <int>(new[] { 1, 2 }) as IList;

            Assert.False(deque.Contains(3));
        }
Example #7
0
        public void NongenericIsReadOnly_ReturnsFalse()
        {
            var deque = new Deque <int>() as IList;

            Assert.False(deque.IsReadOnly);
        }
Example #8
0
        public void IsReadOnly_ReturnsFalse()
        {
            var deque = new Deque <int>();

            Assert.False(((ICollection <int>)deque).IsReadOnly);
        }
Example #9
0
        public void NongenericContains_ItemPresent_ReturnsTrue()
        {
            var deque = new Deque <int>(new[] { 1, 2 }) as IList;

            Assert.True(deque.Contains(2));
        }
Example #10
0
        public void Contains_ItemNotPresent_ReturnsFalse()
        {
            var deque = new Deque <int>(new[] { 1, 2 }) as ICollection <int>;

            Assert.False(deque.Contains(3));
        }
Example #11
0
        public void Contains_ItemPresent_ReturnsTrue()
        {
            var deque = new Deque <int>(new[] { 1, 2 }) as ICollection <int>;

            Assert.True(deque.Contains(2));
        }
Example #12
0
        public void Constructor_FromEmptySequence_UsesDefaultCapacity()
        {
            var deque = new Deque <int>(new int[] { });

            Assert.Equal(DefaultCapacity, deque.Capacity);
        }
Example #13
0
        public void Constructor_CapacityOf1_UsesSpecifiedCapacity()
        {
            var deque = new Deque <int>(1);

            Assert.Equal(1, deque.Capacity);
        }
Example #14
0
        public void Constructor_WithoutExplicitCapacity_UsesDefaultCapacity()
        {
            var deque = new Deque <int>();

            Assert.Equal(DefaultCapacity, deque.Capacity);
        }