示例#1
0
 public void LoadAndSaveJSON()
 {
     string pathJSON = @"C:\Document\Programs\Net\text.csv";
     string filePathJSON = @"C:\Document\Programs\text.csv";
     var fm = new FileManager();
     var AnotherList = fm.LoadJSON(pathJSON);
     fm.SaveJSON(filePathJSON, AnotherList);
     var nList = fm.LoadJSON(filePathJSON);
     StreamReader str1 = new StreamReader(pathJSON);
     StreamReader str2 = new StreamReader(filePathJSON);
     NUnit.Framework.FileAssert.AreEqual(str1.BaseStream, str2.BaseStream);
 }
示例#2
0
        static void Main(string[] args)
        {

            string filePathXML = @"C:\Document\Programs\text.xml";
            string filePathCSV = @"C:\Document\Programs\text.csv";
            string filePathJSON = @"C:\Document\Programs\text.json";
            string filePathYAML = @"C:\Document\Programs\textYAML.yaml";
            int l = 15;
            FileManager bb = new FileManager();
            List<Diary> zz = bb.CreateArr(l);
          //  bb.SaveYAML(filePathYAML, zz);

            bb.LoadYAML(filePathYAML);


            //bb.SaveXML(filePathXML, zz);
            //bb.SaveCSV(filePathCSV, zz);
            //bb.SaveJSON(filePathJSON, zz);

            //bb.LoadXML(filePathXML);


        }