コード例 #1
0
        public void AllPassedFilterTest()
        {
            var check = new int[] { -1, 0, 5, 22, 44, 13451, 23, -43252, 555 };

            list = ListMethods.Filter(list, x => x > -50000);
            AssertAll(list, check);
        }
コード例 #2
0
        public void EvenFilterTest()
        {
            var check = new int[] { 0, 22, 44, -43252 };

            list = ListMethods.Filter(list, x => x % 2 == 0);
            AssertAll(list, check);
        }
コード例 #3
0
        public void NegativeFilterTest()
        {
            var check = new int[] { -1, -43252 };

            list = ListMethods.Filter(list, x => x < 0);
            AssertAll(list, check);
        }
コード例 #4
0
        public void PositiveFilterTest()
        {
            var check = new int[] { 5, 22, 44, 13451, 23, 555 };

            list = ListMethods.Filter(list, x => x > 0);
            AssertAll(list, check);
        }
コード例 #5
0
        public void TwoFilterTest()
        {
            var check = new int[] { 0, 22, 44 };

            list = ListMethods.Filter(list, x => x % 2 == 0);
            list = ListMethods.Filter(list, x => x >= 0);
            AssertAll(list, check);
        }
コード例 #6
0
 public void NonePassedFilterTest()
 {
     list = ListMethods.Filter(list, x => x == -50000);
     Assert.AreEqual(list.Count, 0);
 }