public void ReadFile_FileIsEmpty() { string fileName = "EmptyFile.txt"; CreateEmptyInputFile(fileName); IFileHelper expenseFileHelper = new ExpenseFileHelper(fileName); expenseFileHelper.ReadFile(); }
public void ValidateFile_NothingToProcess() { string fileName = "FileNothingToProcess.txt"; CreateInputFileNothingToProcess(fileName); IFileHelper expenseFileHelper = new ExpenseFileHelper(fileName); expenseFileHelper.ReadFile(); expenseFileHelper.ValidateFile(); }
public void CreateOutput_CheckOutputName() { string fileName = "TestExpenses.txt"; CreateInputFile(fileName); IFileHelper expenseFileHelper = new ExpenseFileHelper(fileName); expenseFileHelper.ReadFile(); expenseFileHelper.ValidateFile(); expenseFileHelper.CreateOutput(); Assert.IsTrue(FileExists(fileName + ".out")); }
public void ValidateFile_CheckExpenses() { string fileName = "TestExpenses.txt"; CreateInputFile(fileName); IFileHelper expenseFileHelper = new ExpenseFileHelper(fileName); expenseFileHelper.ReadFile(); expenseFileHelper.ValidateFile(); List <Expense> expenses = expenseFileHelper.GetExpenses(); Assert.AreEqual(expenses.Count, 1); Assert.AreEqual(expenses[0].Participants.Count, 2); Assert.AreEqual(expenses[0].Participants[0].TotalCharge, 14.00); Assert.AreEqual(expenses[0].Participants[1].TotalCharge, 15.95); }
public void ReadFile_NoExists() { IFileHelper expenseFileHelper = new ExpenseFileHelper("NoFile.txt"); expenseFileHelper.ReadFile(); }