Example #1
0
        public void TC_ShouldWriteList() {  
            addSheet();
            var target = getRange("A1");

            var list = new List();
            list.AddRange(new object[] { 665, 987897, 909 });
            list.ToExcel(target, "Mytitle", true);

            A.AreEqual("Mytitle", getValue("A1"));
            A.AreEqual(665, getValue("A2"));
            A.AreEqual(909, getValue("A4"));
            A.AreEqual(null, getValue("A5"));
        }
Example #2
0
        //Require Administrator rights
        public static void TestListToExcel()
        {
            List<Name> names = new List<Name>();

            for (int i = 0; i < 5; i++)
            {
                Name name = new Name();
                name.FirstName = "Mustafa" + i;

                names.Add(name);
            }

            names.ToExcel("c:\\musta.xls");
        }