Exemple #1
0
        public void ListWithPredicateTest()
        {
            var list = new ListWithPredicates <int>(i => i > 5, 0);

            list.Add(6);
            list.Add(7);
            Assert.Throws <InvalidOperationException>(() => list.Add(5));
        }
Exemple #2
0
        public void MinimumCountIsNonZeroTest()
        {
            Assert.Throws <InvalidOperationException>(() => new ListWithPredicates <int>(null, 3));
            var list = new ListWithPredicates <int>(null, 3, 1, 2, 3);

            Assert.Throws <InvalidOperationException>(() => list.RemoveAt(0));
            list.Add(4);
            list.Add(5);
            list.RemoveAt(0);
        }
Exemple #3
0
        public void MinimumCountIsZeroTest()
        {
            var list = new ListWithPredicates <int>(null, 0);

            list.Add(0);
            list.Clear();
        }