예제 #1
0
        public void NongenericContains_WrongItemType_ReturnsFalse()
        {
            var list = new List <int>(new[] { 1, 2 }) as IList;

            Assert.False(list.Contains(this));

            var deque = new Deque <int>(new[] { 1, 2 }) as IList;

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

            Assert.False(deque.Contains(3));
        }
예제 #3
0
        public void NongenericContains_ItemPresent_ReturnsTrue()
        {
            var deque = new Deque <int>(new[] { 1, 2 }) as IList;

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

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

            Assert.True(deque.Contains(2));
        }