Exemplo n.º 1
0
 public void CopyAndInsertRowTest()
 {
     File.Copy("template.xlsx", CalcPath("test.xlsx"));
     using (var excel = new OperateExcel())
     {
         excel.Open(CalcPath("test.xlsx"));
         excel.CopyAndInsertRow(1, 2, 2, "Sheet2");
         excel.CopyAndInsertRow(2, 2, 1);
         Assert.AreEqual("1", excel.Read <string>(Cell.R1C1(2, 2)));
         Assert.AreEqual("4", excel.Read <string>(Cell.R1C1(2, 5)));
         Assert.AreEqual("あ", excel.Read <string>(Cell.R1C1(3, 2)));
         Assert.AreEqual("あ", excel.Read <string>(Cell.R1C1(4, 2)));
         Assert.AreEqual("え", excel.Read <string>(Cell.R1C1(3, 5)));
         Assert.AreEqual("え", excel.Read <string>(Cell.R1C1(4, 5)));
     }
 }