public void TestWriteTableFile1()
        {
            var tabFileWrite = new TabFileWriter<TestWrite>();
            var newRow = tabFileWrite.NewRow();
            newRow.TestColumn1 = "Test String";
            newRow.TestColumn2 = 123123;

            tabFileWrite.Save("./test_write.bytes");

            var tabFileRead = TableFile<TestWrite>.LoadFromFile("./test_write.bytes");
            Assert.AreEqual(tabFileRead.GetHeight(), 1);
        }
示例#2
0
        public void TestRemoveRowTableFile1()
        {
            var tabFileWrite = new TabFileWriter <TestWrite>();
            var newRow       = tabFileWrite.NewRow();

            newRow.TestColumn1 = "Test String";
            newRow.TestColumn2 = 123123;
            tabFileWrite.RemoveRow(newRow.RowNumber);  // remove row 1
            tabFileWrite.Save("./test_write.bytes");


            var tabFileRead = TableFile <TestWrite> .LoadFromFile("./test_write.bytes");

            Assert.AreEqual(tabFileRead.GetHeight(), 0);
        }
示例#3
0
        public void TestWriteTableFile2()
        {
            var tabFile = TableFile <TestWrite> .LoadFromFile("./test_write.bytes");

            var tabFileWrite = new TabFileWriter <TestWrite>(tabFile);

            var newRow = tabFileWrite.NewRow();

            newRow.TestColumn1 = Path.GetRandomFileName();
            newRow.TestColumn2 = new Random().Next();


            // 两个方法执行后
            Assert.AreEqual(tabFile.GetHeight(), 2);

            tabFileWrite.Save("./test_write.bytes");
        }
        public void TestWriteTableFile2()
        {
            var tabFile = TableFile<TestWrite>.LoadFromFile("./test_write.bytes");

            var tabFileWrite = new TabFileWriter<TestWrite>(tabFile);

            var newRow = tabFileWrite.NewRow();
            newRow.TestColumn1 = Path.GetRandomFileName();
            newRow.TestColumn2 = new Random().Next();

            // 两个方法执行后
            Assert.AreEqual(tabFile.GetHeight(), 2);

            tabFileWrite.Save("./test_write.bytes");
        }