Exemplo n.º 1
0
        void TestR5()
        {
            "Demonstrating Requirement #5".title();
            DBElement <int, string> elem2 = new DBElement <int, string>();

            elem2.name      = "element#2";//add a new key/value pairs
            elem2.descr     = "test element#2";
            elem2.timeStamp = DateTime.Now;
            elem2.children.AddRange(new List <int> {
                16, 48
            });
            elem2.payload = "elem#2's payload";
            //elem2.showElement();
            db.insert(7, elem2);

            PersistToXML toxml = new PersistToXML(db);

            toxml.writeXML();

            Write("\n --- Test read XML file Start---");
            LoadXML fromxml = new LoadXML(db, @"C:\Users\lxinghe\Downloads\Project2Starter\ReadFile.xml");

            fromxml.WriteToDBEngine();

            Write("\n\n Show key/value pairs in data base:\n");
            db.showDB();

            Write("\n --- Test read XML file End---");
            WriteLine();
        }
Exemplo n.º 2
0
    void TestR5()
    {
      "Demonstrating Requirement #5".title();
	  DBElement<int, string> elem2 = new DBElement<int, string>();
      elem2.name = "element#2";//add a new key/value pairs
      elem2.descr = "test element#2";
      elem2.timeStamp = DateTime.Now;
      elem2.children.AddRange(new List<int>{ 16, 48 });
      elem2.payload = "elem#2's payload";
      //elem2.showElement();
      db.insert(7, elem2);
	 
	  PersistToXML toxml  = new PersistToXML(db);
	  toxml.writeXML();
	  
	  Write("\n --- Test read XML file Start---");
      LoadXML fromxml = new LoadXML(db, @"C:\Users\lxinghe\Downloads\Project2Starter\ReadFile.xml");
	  fromxml.WriteToDBEngine();
	  
	  Write("\n\n Show key/value pairs in data base:\n");
      db.showDB();
	  
	  Write("\n --- Test read XML file End---");
      WriteLine();
    }