Example #1
0
 public void MapFunctionTest()
 {
     Map map = new Map();
     List<int> list = map.MapFunction(new List<int>() { 1, 2, 3 }, function => function * 2);
     for (int i = 0; i < list.Count; ++i)
     {
         Assert.AreEqual(list[i], (i + 1) * 2);
     }
 }
Example #2
0
        /// <summary>
        /// The entry point of the program
        /// </summary>
        /// <param name="args"></param>
        public static void Main(string[] args)
        {
            Map map = new Map();
            List<int> modifiedList = map.MapFunction(new List<int>() { 1, 2, 3 }, function => function * 2);

            for (int i = 0; i < modifiedList.Count; ++i)
            {
                Console.Write(modifiedList[i] + " ");
            }
        }