Esempio n. 1
0
        public List<Holidayhome> getCSVdata()
        {
            if (!File.Exists(Holidayhomefile))
            {
                return null;
            }

            Reader = new StreamReader(Holidayhomefile);
            CSVParser dataparse = new CSVParser();

            dataparse.setStreamSource(Reader);
            return (dataparse.parseHolidayhomes());
        }
Esempio n. 2
0
        public List <Holidayhome> getCSVdata()
        {
            if (!File.Exists(Holidayhomefile))
            {
                return(null);
            }

            Reader = new StreamReader(Holidayhomefile);
            CSVParser dataparse = new CSVParser();

            dataparse.setStreamSource(Reader);
            return(dataparse.parseHolidayhomes());
        }
Esempio n. 3
0
        public List<Owner> getCSVOwnerdata()
        {
            //Checks to see your CSV file exists
            if (!File.Exists(Holidayhomefile))
            {
                return null;
            }

            Reader = new StreamReader(Ownerfile);
            CSVParser dataparse = new CSVParser();

            dataparse.setStreamSource(Reader);
            return (dataparse.parseOwners());
        }
Esempio n. 4
0
        public List<Booking> getCSVBookingdata()
        {
            //Checks to see your CSV file exists
            if (!File.Exists(Bookingfile))
            {
                return null;
            }

            Reader = new StreamReader(Bookingfile);
            CSVParser dataparse = new CSVParser();

            dataparse.setStreamSource(Reader);
            return (dataparse.parseBookings());
        }
Esempio n. 5
0
        public List <Booking> getCSVBookingdata()
        {
            //Checks to see your CSV file exists
            if (!File.Exists(Bookingfile))
            {
                return(null);
            }

            Reader = new StreamReader(Bookingfile);
            CSVParser dataparse = new CSVParser();

            dataparse.setStreamSource(Reader);
            return(dataparse.parseBookings());
        }
Esempio n. 6
0
        public List <Owner> getCSVOwnerdata()
        {
            //Checks to see your CSV file exists
            if (!File.Exists(Holidayhomefile))
            {
                return(null);
            }

            Reader = new StreamReader(Ownerfile);
            CSVParser dataparse = new CSVParser();

            dataparse.setStreamSource(Reader);
            return(dataparse.parseOwners());
        }
Esempio n. 7
0
        public void parseHolidayhomesTest1()
        {
            StreamReader reader = new StreamReader("d:\\nci\\holidayhomes.csv");
                  CSVParser target = new CSVParser();
                  target.setStreamSource(reader);

                  Holidayhome hse = new Holidayhome();
                  hse.holidayhomeno="Spain";
                  hse.address1="San Costa";
                  hse.address2="Valencia";
                  hse.country = "Spain";
                  hse.email="*****@*****.**";
                  hse.contactno="+353 18767352";
                  hse.amenities="Swimming Pool| Gym | Sauna";
                  hse.price="445";

                 List<Holidayhome> expected = new List<Holidayhome>();
                 expected.Add(hse);
                 List<Holidayhome> actual = target.parseHolidayhomes();

                 Assert.AreEqual(expected[0].address1, actual[0].address1);
                 Assert.AreEqual(expected[0].country, actual[0].country);
                 Assert.AreEqual(expected[0].contactno, actual[0].contactno);
        }
Esempio n. 8
0
 public void setStreamSourceOwnerTest()
 {
     string Ownerfile = "d:\\nci\\owners.csv";
     CSVParser target = new CSVParser();
     StreamReader reader = new StreamReader(Ownerfile);
     target.setStreamSource(reader);
 }
Esempio n. 9
0
 public void setStreamSourceHolidayhomeTest()
 {
     string Holidayhomefile = "D:\\NCI\\holidayhomes.csv";
         CSVParser target = new CSVParser();
         StreamReader reader = new StreamReader(Holidayhomefile);
         target.setStreamSource(reader);
 }
Esempio n. 10
0
        public void parseOwnersTest()
        {
            StreamReader reader = new StreamReader("d:\\nci\\owners.csv");
            CSVParser target = new CSVParser();
            target.setStreamSource(reader);

            Owner owns = new Owner();
            owns.firstname="Alexander";
            owns.surname="Carson";
            owns.address1="92 Margarenstrasse";
            owns.address2="Vienna";
            owns.country = "Italy";
            owns.email="*****@*****.**";
            owns.contactno="+353 67639287828";
            owns.holidayhomeno="9876";

            List<Owner> expected = new List<Owner>();
            expected.Add(owns);
            List<Owner> actual;
            actual = target.parseOwners();

            Assert.AreEqual(expected[0].address1, actual[0].address1);
            Assert.AreEqual(expected[0].country, actual[0].country);
            Assert.AreEqual(expected[0].contactno, actual[0].contactno);
        }