public void Test_Clear_IOFile() { var testLogHelper = new TestLogHelper(); testLogHelper.ClearMortgages(); string filepath = testLogHelper.GetFilePath(); Assert.AreEqual(new FileInfo(filepath).Length, 0); }
public void Test_Add_IOFile() { var testLogHelper = new TestLogHelper(); string text = $"With a principal of $1000, duration of 2 years and an interest rate of 3%, the monthly loan payment amount is $42.98"; testLogHelper.AddMortgage(text, 1000, 3, 2, 4000); string expectedtext = File.ReadLines(testLogHelper.GetFilePath()).Last().Split(';')[0]; Assert.AreEqual(expectedtext, text); testLogHelper.ClearMortgages(); }