public void parseMuseumsTest()
        {
            //** Actual Museum Object **//
            string fnameMuseums = "C:\\Louise\\Semester3\\EnterpriseFrameworks\\GroupProj\\MupadoodleAPI-Complete\\Museums_ParserTest.csv";
            StreamReader myReader = new StreamReader(fnameMuseums);
            CSVParser target = new CSVParser();
            target.setStreamSource(myReader);

            //**Test Museum Oject **//
            string cityStr = "New York";
            double lat = 40.7, lng = -74.01;
            string theName = "Alexander Hamilton U.S. Custom House", theUrl = "http://www.oldnycustomhouse.gov/", add1 = "1 Bowling Grn", add2 = null, theZip = "10004", phone = " 514-3700";
            Museum mTest = new Museum(lat, lng, theName, phone, theUrl, add1, add2, theZip, cityStr);

            //** Expected **//
            List<Museum> expected = new List<Museum>();
            expected.Add(mTest);

            //** Actual **//
            List<Museum> actual;
            actual = target.parseMuseums();

            //** First Test **//
            Assert.AreEqual(expected.Count, actual.Count);

            //** Second Test **//
            Museum museumCity = actual.Find(item => item.cityStr == "New York");
            Assert.IsNotNull(museumCity);

            //** Third Test - Test parseShape **//
            Museum museumLat = actual.Find(item => item.latitude == 40.7);
            Assert.IsNotNull(museumLat);
        }
        // POST api/Admin
        public HttpResponseMessage PostMuseum(Museum museum)
        {
            if (ModelState.IsValid)
            {
                db.museums.Add(museum);
                db.SaveChanges();

                HttpResponseMessage response = Request.CreateResponse(HttpStatusCode.Created, museum);
                response.Headers.Location = new Uri(Url.Link("DefaultApi", new { id = museum.LocationID }));
                return response;
            }
            else
            {
                return Request.CreateResponse(HttpStatusCode.BadRequest);
            }
        }
        public void addMuseumToDbTest()
        {
            MuseumDAL target = new MuseumDAL();

            double lat = 40.7669569450;
            double lng = -73.937655144;
            string theName = "Test Museum",theUrl = "www.testmuseum.com", add1 = "Bronx", add2 = null, theZip = "008", phone = "007007";
            string cityStr = "New York";

            Museum mTest = new Museum(lat, lng, theName, phone, theUrl, add1, add2, theZip, cityStr);

            bool expected = true;
            bool actual;
            actual = target.addMuseumToDb(mTest);

            // ** Check it was added **/
            Assert.AreEqual(expected, actual);
        }
        // PUT api/Admin/5
        public HttpResponseMessage PutMuseum(int id, Museum museum)
        {
            if (ModelState.IsValid && id == museum.LocationID)
            {
                db.Entry(museum).State = EntityState.Modified;

                try
                {
                    db.SaveChanges();
                }
                catch (DbUpdateConcurrencyException)
                {
                    return Request.CreateResponse(HttpStatusCode.NotFound);
                }

                return Request.CreateResponse(HttpStatusCode.OK, museum);
            }
            else
            {
                return Request.CreateResponse(HttpStatusCode.BadRequest);
            }
        }
        public bool addMuseumToDb(Museum m)
        {
            Museum inm = new Museum();
            try
            {
                inm = db.museums.Add(m);
            }

            catch (Exception e)
            {
                Exception j = e;
                return false;
                //do something
            }

            if (inm is Museum)
            {
                db.SaveChanges();
                return true;
            }
            return false;
        }
        public List<Models.Museum> parseMuseums()
        {
            CsvReader csv = new CsvReader(reader, true);
            int fieldCount = csv.FieldCount;
            List<Museum> exList = new List<Museum>();
            Museum exObj = null;

            String[] headers = csv.GetFieldHeaders();

            while (csv.ReadNextRecord())
            {
                string cityStr = null;
                double lat = 0, lng = 0;
                string theName = null, theUrl = null, add1 = null, add2 = null, theZip = null, phone = null;

                for (int i = 0; i < fieldCount; i++)
                {
                    // this is where you actually create your dB object
                    if (headers[i].Equals("Shape"))
                    {
                        parseShape(csv[i],  ref lat, ref lng);
                    }
                    else if (headers[i].Equals("NAME"))
                    {
                        theName = csv[i];
                    }
                    else if (headers[i].Equals("TEL"))
                    {
                        phone = csv[i];
                    }
                    else if (headers[i].Equals("URL"))
                    {
                        theUrl = csv[i];
                    }
                    else if (headers[i].Equals("ADRESS1")) // intentionally misspelt
                    {
                        add1 = csv[i];
                    }
                    else if (headers[i].Equals("ADDRESS2"))
                    {
                        add2 = csv[i];
                    }
                    else if (headers[i].Equals("ZIP"))
                    {
                        theZip = csv[i];
                    }
                    else if (headers[i].Equals("CITY"))
                    {
                        cityStr = csv[i];
                    }
                }

                exObj = new Museum(lat, lng, theName, phone, theUrl, add1, add2, theZip, cityStr);
                exList.Add(exObj);
            }

            return exList;

            //throw new NotImplementedException();
        }
 public bool updateMuseumInDb(Museum m)
 {
     db.Entry(m).State = EntityState.Modified;
     try
     {
         db.SaveChanges();
         return true;
     }
     catch (Exception e)
     {
         // do something
         return false;
     }
 }