Esempio n. 1
0
        public void CreateStationTest()
        {
            ITableToModel exsaver   = new TableToExcel();
            var           forAssert = exsaver.CreateStation("TestStation");

            Assert.IsNotNull(forAssert as TableToExcel);
        }
Esempio n. 2
0
        public void TableToModelConvTest()
        {
            ITableToModel exsaver = new TableToExcel();
            var           table   = new DataTable();

            table.Columns.Add("TestColumn");
            var row = table.NewRow();

            row[0] = "testtext";
            table.Rows.Add(row);
            exsaver.CreateStation("TestStation");
            bool asserting = exsaver.TableToModelConv("TestTable", table, null, null, null, KindOfTable.manual);

            Assert.IsTrue(asserting);
        }
Esempio n. 3
0
        public void SerializeModelTest()
        {
            ITableToModel exsaver  = new TableToExcel();
            var           table    = new DataTable();
            const string  fileName = "ExcelSaverTest";

            if (File.Exists(fileName))
            {
                File.Delete(fileName);
            }

            table.Columns.Add("TestColumn");
            var row = table.NewRow();

            row[0] = "testtext";
            table.Rows.Add(row);
            exsaver.CreateStation("TestStation");
            exsaver.TableToModelConv("TestTable", table, null, null, null, KindOfTable.manual);
            exsaver.SerializeModel(fileName);

            Assert.IsTrue(File.Exists(fileName + ".xlsx"));
        }