public void ValidatesRemoveMethodThatReturnsFalse()
        {
            var list = new LinkedListCollection <int> {
                1, 2, 3
            };

            Assert.False(list.Remove(4));
        }
예제 #2
0
        public void ArgumentNullRemoveMethodException()
        {
            var test = new LinkedListCollection <int> {
                1, 2
            };
            LinkedListNode <int> nullNode = null;

            Assert.Throws <ArgumentNullException>(() => test.Remove(nullNode));
        }
예제 #3
0
        public void IsReadOnlyRemoveMethodException()
        {
            var test = new LinkedListCollection <int>();

            test.Add(1);
            test.Add(2);
            test = test.ReadOnlyList();
            Assert.Throws <NotSupportedException>(() => test.Remove(2));
        }
        public void ValidatesRemoveMethod()
        {
            var list = new LinkedListCollection <int> {
                1, 2, 3
            };

            Assert.True(list.Remove(2));
            Assert.Equal(1, list.GetFirst.Value);
            Assert.Equal(3, list.GetLast.Value);
        }
예제 #5
0
        public void RemoveMethodInvalidOperationException()
        {
            var test = new LinkedListCollection <int> {
                1, 2
            };
            var secondTestList = new LinkedListCollection <int> {
                1, 2
            };
            LinkedListNode <int> node = new LinkedListNode <int>(3);

            secondTestList.Add(node);
            Assert.Throws <InvalidOperationException>(() => test.Remove(node));
        }