示例#1
0
 public void Address4Test()
 {
     Amenity target = new Amenity(); // TODO: Initialize to an appropriate value
     string expected = string.Empty; // TODO: Initialize to an appropriate value
     string actual;
     target.Address4 = expected;
     actual = target.Address4;
     Assert.AreEqual(expected, actual);
     Assert.Inconclusive("Verify the correctness of this test method.");
 }
示例#2
0
        public ActionResult Create(Amenity amenity)
        {
            if (ModelState.IsValid)
            {
                db.Amenities.Add(amenity);
                db.SaveChanges();
                return RedirectToAction("Index");
            }

            return View(amenity);
        }
示例#3
0
        List<Models.Amenity> IDataParser.parseAmenity(String amenitytype)
        {
            CsvReader csv = new CsvReader(reader, true);
            int fieldCount = csv.FieldCount;

            List<Amenity> facility = new List<Amenity>();

            String[] headers = csv.GetFieldHeaders();

            while (csv.ReadNextRecord())
            {
                Amenity exObj = new Amenity();

                for (int i = 0; i < fieldCount; i++)
                { // need to make this more robust for non expected values
                    if (headers[i].Equals("Name")) {
                        exObj.Name = csv[i];
                    } else if (headers[i].Equals("Address1")) {
                        exObj.Address1 = csv[i];
                    } else if (headers[i].Equals("Address2")) {
                        exObj.Address2 = csv[i];
                    } else if (headers[i].Equals("Address3")) {
                        exObj.Address3 = csv[i];
                    } else if (headers[i].Equals("Address4")) {
                        exObj.Address4 = csv[i];
                    } else if (headers[i].Equals("Phone")) {
                        exObj.Phone = csv[i];
                    } else if (headers[i].Equals("Email")) {
                        exObj.Email = csv[i];
                    } else if (headers[i].Equals("Website")) {
                        exObj.Website = csv[i];
                    } else if (headers[i].Equals("LAT")) {
                        exObj.Lat = Convert.ToDouble(csv[i]);
                    } else if (headers[i].Equals("LONG")) {
                        exObj.Long = Convert.ToDouble(csv[i]);
                    }
                }
              exObj.Type = amenitytype;
                facility.Add(exObj);
            }
            return facility;
        }
示例#4
0
 public ActionResult Edit(Amenity amenity)
 {
     if (ModelState.IsValid)
     {
         db.Entry(amenity).State = EntityState.Modified;
         db.SaveChanges();
         return RedirectToAction("Index");
     }
     return View(amenity);
 }
示例#5
0
 public void AmenityIDTest()
 {
     Amenity target = new Amenity(); // TODO: Initialize to an appropriate value
     int expected = 0; // TODO: Initialize to an appropriate value
     int actual;
     target.AmenityID = expected;
     actual = target.AmenityID;
     Assert.AreEqual(expected, actual);
     Assert.Inconclusive("Verify the correctness of this test method.");
 }
示例#6
0
 public void LongitudeTest()
 {
     Amenity target = new Amenity(); // TODO: Initialize to an appropriate value
     double expected = 0F; // TODO: Initialize to an appropriate value
     double actual;
     target.Longitude = expected;
     actual = target.Longitude;
     Assert.AreEqual(expected, actual);
     Assert.Inconclusive("Verify the correctness of this test method.");
 }