Ejemplo n.º 1
0
        public void ShouldNotUpdateAdvertWithWrongId()
        {
            Advert a = new Advert()
            {
                Id                = 12,
                FuelType          = "Gasoline",
                FirstRegistration = new DateTime(2012, 10, 02),
                Title             = "Golf Avant",
                IsNew             = false,
                Mileage           = 25000,
                Price             = 12000
            };

            Assert.Throws <NotFoundException>(() => _advertRepository.Update(a));
        }
Ejemplo n.º 2
0
 public ActionResult Edit(int id, Advert advert)
 {
     try
     {
         advRepository.Update(advert);
         return(RedirectToAction("Index"));
     }
     catch
     {
         return(View(advert));
     }
 }