public void clsFrequencyTest() { String readPth = "C:\\dev\\data.csv"; clsReadCSV readfile = new clsReadCSV(readPth); clsFrequency frequency = new clsFrequency(readfile.readCsvFile()); DataTable dt = frequency.getFrequencyOfFirstAndLastName(); Assert.AreNotSame(dt, readfile.readCsvFile());//are not the same }
public void clsOrderByAddressTest() { String readPth = "C:\\dev\\data.csv"; clsReadCSV readfile = new clsReadCSV(readPth); DataTable dtnotOrdered = readfile.readCsvFile(); clsOrderByAddress orderBy = new clsOrderByAddress(readfile.readCsvFile()); DataTable dtOrdered = orderBy.getAlphabeticalOrder(); Assert.Equals(dtOrdered, dtnotOrdered);//must fail if is correct. }
public void clsReadCSVTest() { String readPth = "C:\\dev\\data.csv"; clsReadCSV readfile = new clsReadCSV(readPth); DataTable dt = readfile.readCsvFile(); DataTable dt2 = new DataTable(); Assert.AreNotEqual(dt2, dt);//expected pass }
public void clsCreateCSVFileTest() { string readPth = ConfigurationManager.AppSettings["Path"]; clsReadCSV readfile = new clsReadCSV(readPth); clsFrequency frequency = new clsFrequency(readfile.readCsvFile()); string writePath = ConfigurationManager.AppSettings["Path2"]; //write clsCreateCSVFile createFirstFile = new clsCreateCSVFile("frequency", frequency.getFrequencyOfFirstAndLastName(), writePath); Assert.IsTrue(createFirstFile.writeToCSVfile()); //sort alphabeticall clsOrderByAddress orderBy = new clsOrderByAddress(readfile.readCsvFile()); clsCreateCSVFile secondFile = new clsCreateCSVFile("alphabetical", orderBy.getAlphabeticalOrder(), writePath); secondFile.writeToCSVfile(); Assert.IsTrue(secondFile.writeToCSVfile()); }