Exemple #1
0
        public void ReadFromTxt_NotExist_ReturnEmpty()
        {
            TxtDB txtDb = new TxtDB("testEmpty");

            Assert.IsEmpty(txtDb.ReadLastLine());
            txtDb.DumpFile();
        }
Exemple #2
0
        public void WriteAndReadJsonData()
        {
            TxtDB txtDb = new TxtDB("jsonTest");

            txtDb.OverWrite(JsonConvert.SerializeObject(TestObj.GetTestObj(), Formatting.Indented));

            string jsontxt = txtDb.ReadAll();

            Assert.AreEqual(JsonConvert.DeserializeObject <TestObj>(jsontxt), TestObj.GetTestObj());

            txtDb.DumpFile();
        }