Exemplo n.º 1
0
        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
        }
Exemplo n.º 2
0
        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.
        }
Exemplo n.º 3
0
        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
        }
Exemplo n.º 4
0
        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());
        }