コード例 #1
0
        public void XmlTableManager()
        {
            // LogFile
            // Create file
            string logFile = Path.Combine(logPath, "xmlLog.xml");
            var    tm      = new XmlTableManager(logPath, "xmlLog");

            Assert.IsTrue(File.Exists(logFile));
            // Create row
            int id = tm.Create("New row");

            // Last Id must be equal to id created.
            Assert.AreEqual(id, tm.GetLastId());
            // Read the new row
            var row = tm.Read(id);

            Assert.True(row.Contains("New row"));
            // Update the new row
            tm.Update(id, "value", "Updated row");
            row = tm.Read(id);
            Assert.True(row.Contains("Updated row"));
            // Delete the new row
            tm.Delete(id);
            // Read the deleted row, it must be gone.
            row = tm.Read(id);
            Assert.IsEmpty(row);
        }
コード例 #2
0
 public static void Main(string[] args)
 {
     GetSettings();
     using (ow = new OutputWrapper(configXml))
     {
         using (xm = new XmlTableManager(logPath, "xmlLog"))
         {
             ow.XmlManager = xm;
             LogUtil.Instance.Start(Path.Combine(logPath, configXml));
             Process();
         }
     }
 }