コード例 #1
0
ファイル: AmenityTest.cs プロジェクト: Tamakloe/EF_Project
 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
ファイル: CSVParser.cs プロジェクト: annam72/EF_Project
        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
ファイル: AmenityTest.cs プロジェクト: Tamakloe/EF_Project
 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
ファイル: AmenityTest.cs プロジェクト: Tamakloe/EF_Project
 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.");
 }