public void ReadFromTxt_NotExist_ReturnEmpty() { TxtDB txtDb = new TxtDB("testEmpty"); Assert.IsEmpty(txtDb.ReadLastLine()); txtDb.DumpFile(); }
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(); }