public void TestChangeIndexDownCollection()
        {
            IList <TestClassMapper1> list = new List <TestClassMapper1>();

            list.Add(new TestClassMapper1()
            {
                Column1 = "0", Column2 = "Row0"
            });
            list.Add(new TestClassMapper1()
            {
                Column1 = "1", Column2 = "Row1"
            });
            list.Add(new TestClassMapper1()
            {
                Column1 = "2", Column2 = "Row2"
            });
            list.Add(new TestClassMapper1()
            {
                Column1 = "3", Column2 = "Row3"
            });
            list.Add(new TestClassMapper1()
            {
                Column1 = "4", Column2 = "Row4"
            });
            list.Add(new TestClassMapper1()
            {
                Column1 = "5", Column2 = "Row5"
            });
            list.Add(new TestClassMapper1()
            {
                Column1 = "6", Column2 = "Row6"
            });
            list.Add(new TestClassMapper1()
            {
                Column1 = "7", Column2 = "Row7"
            });


            TestClassMapper1 find = list.SingleOrDefault(a => a.Column1 == "3");
            int oldindex          = list.IndexOf(find);

            if (find != null)
            {
                ChangeIndex(list, find, false);
            }

            int index = list.IndexOf(find);


            Assert.AreEqual(4, index);
        }
        public void ChangeIndex(IList <TestClassMapper1> list, TestClassMapper1 data, Boolean IsUp = true)
        {
            int index = list.IndexOf(data);

            if (IsUp)
            {
                list.Insert(index - 1, data);
                list.RemoveAt(index + 1);
            }
            else
            {
                list.Insert(index + 2, data);
                list.RemoveAt(index);
            }
        }