Exemplo n.º 1
0
        /// <summary>
        /// The entry point of the program
        /// </summary>
        /// <param name="args"></param>
        public static void Main(string[] args)
        {
            Filter filter = new Filter();
            List<int> filteredList = filter.FilterFunction(new List<int>() { 1, 2, 3, 4, 5 }, function => function % 2 == 0);

            for (int i = 0; i < filteredList.Count; ++i)
            {
                Console.Write(filteredList[i] + " ");
            }
        }
Exemplo n.º 2
0
        public void FilterFunctionTest()
        {
            Filter filter = new Filter();
            List<int> list = filter.FilterFunction(new List<int>() { 1, 2, 3, 4, 5 }, function => function % 2 == 1);

            for (int i = 0; i < list.Count; ++i)
            {
                Assert.AreEqual(list[i], (i * 2 + 1));
            }
        }