Example #1
0
        public void FileIOManagerQueueTest()
        {
            IniCreator ic =
                new IniCreator(Environment.CurrentDirectory + "/MyECFMail.ini");

            string filepath  = Environment.CurrentDirectory + "/MyECFMail.ini";
            string filepath2 = Environment.CurrentDirectory + "/Memmy.ini";
            var    e         = new Entry("users", "tester1", "tester1value");
            var    ee        = new Entry("users", "tester2", "tester2value");
            var    eee       = new Entry("section1", "property2", "value2");
            var    eeee      = new Entry("section2", "propertyB", "valueB_2");

            bool success = ic.SaveEntry("users", "tester1");

            Assert.IsTrue(success);

            success = ic.SaveEntry("users", "tester1", "tester1value");
            Assert.IsTrue(success);

            //******you ended here testing the multi entry stuff.
            // need a good test dictionary of values.  maybe make
            // separate method that creates it.

            //var entries = new Dictionary<string,Dictionary<string,string>>();
            //Dictionary<string,string> vals = new Dictionary<string,string>();
            //vals.Add("e1", "e1val");
            //vals.Add("e2", "e2val");
            //vals.Add("e3", "e3val");
            //entries.Add("users", vals);
            //success = ic.SaveEntries(entries as IDictionary<string,IDictionary<string,string>>);

            //int loc = "modwyer=XtOnLPcds4G2B9FQx11l+g==".IndexOf('=');
            //var list = FileContents.splitString(loc, "modwyer=XtOnLPcds4G2B9FQx11l+g==");
            //Assert.AreEqual("modwyer", list[0]);
            //Assert.AreEqual("XtOnLPcds4G2B9FQx11l+g==", list[1]);


            //success = ic.SaveEntry();

            //bool success;
            //success = FileIOManager.AddEntryToList(e);
            //Assert.IsTrue(success);
            //success = FileIOManager.AddEntryToList(ee);
            //Assert.IsTrue(success);
            //success = FileIOManager.AddEntryToList(eee);
            //Assert.IsTrue(success);
            //success = FileIOManager.AddEntryToList(eeee);
            //Assert.IsTrue(success);

            FileIOManager.FlushEntries();
        }