public void Can_convert_commas_to_little_hats_for_bank_in() { // Arrange var file_io = new FileIO <BankRecord>(new FakeSpreadsheetRepoFactory(), _csv_file_path, "BankIn-with-commas"); var csv_file = new CSVFile <BankRecord>(file_io); csv_file.Load(true, ','); // Act csv_file.Convert_source_line_separators(',', '^'); // Assert List <string> csv_lines = csv_file.All_records_as_source_lines(); Assert.AreEqual("24/03/2017^£200.12^^PCL^ZZZSpecialDescription001^^^^^", csv_lines[0]); Assert.AreEqual("01/04/2017^£261.40^^PCL^ZZZSpecialDescription005^^^^^", csv_lines[1]); Assert.AreEqual("03/10/2018^£350.00^^ABC^ZZZThing1^^^^^", csv_lines[2]); }
public void Can_output_all_records_as_source_line_ordered_by_date() { // Arrange var file_io = new FileIO <BankRecord>(new FakeSpreadsheetRepoFactory(), _csv_file_path, "BankIn-formatted-date-only"); var csv_file = new CSVFile <BankRecord>(file_io); csv_file.Load(); // Act List <string> csv_lines = csv_file.All_records_as_source_lines(); // Assert Assert.AreEqual("01/02/2017^£350.00^^ABC^ZZZThing3^^^^^", csv_lines[0]); Assert.AreEqual("01/03/2017^£350.00^^ABC^ZZZThing2^^^^^", csv_lines[1]); Assert.AreEqual("24/03/2017^£200.12^^PCL^ZZZSpecialDescription001^^^^^", csv_lines[2]); Assert.AreEqual("01/04/2017^£261.40^^PCL^ZZZSpecialDescription005^^^^^", csv_lines[3]); Assert.AreEqual("03/04/2017^£350.00^^ABC^ZZZThing1^^^^^", csv_lines[4]); }
public void Can_convert_commas_to_little_hats_for_cred_card1_in_out() { // Arrange var file_io = new FileIO <CredCard1InOutRecord>(new FakeSpreadsheetRepoFactory(), _csv_file_path, "CredCard1InOut-with-commas"); var csv_file = new CSVFile <CredCard1InOutRecord>(file_io); csv_file.Load(true, ','); // Act csv_file.Convert_source_line_separators(',', '^'); // Assert List <string> csv_lines = csv_file.All_records_as_source_lines(); Assert.AreEqual("19/12/2016^£7.99^^ZZZSpecialDescription017^", csv_lines[0]); Assert.AreEqual("02/01/2017^£6.29^^ZZZSpecialDescription018^", csv_lines[1]); Assert.AreEqual("15/02/2017^£1.99^^ZZZSpecialDescription019^", csv_lines[2]); Assert.AreEqual("17/10/2018^£1.94^^ZZZSpecialDescription020^", csv_lines[3]); }
public void Can_convert_commas_to_little_hats_for_cred_card2_in_out() { // Arrange var file_io = new FileIO <CredCard2InOutRecord>(new FakeSpreadsheetRepoFactory(), _csv_file_path, "CredCard2InOut-with-commas"); var csv_file = new CSVFile <CredCard2InOutRecord>(file_io); csv_file.Load(true, ','); // Act csv_file.Convert_source_line_separators(',', '^'); // Assert List <string> csv_lines = csv_file.All_records_as_source_lines(); Assert.AreEqual("09/04/2017^£8.33^^ZZZSpecialDescription021^", csv_lines[0]); Assert.AreEqual("01/05/2017^£3.16^^ZZZSpecialDescription022^", csv_lines[1]); Assert.AreEqual("06/05/2017^£11.94^^ZZZSpecialDescription023^", csv_lines[2]); Assert.AreEqual("20/05/2017^£158.32^^ZZZSpecialDescription024^", csv_lines[3]); Assert.AreEqual("21/10/2018^£16.05^^ZZZSpecialDescription025^", csv_lines[4]); }