Exemplo n.º 1
0
 public void GetOffers_TryToGetValue_ShouldThrow()
 {
     NUnit.Framework.Assert.Throws <ArgumentOutOfRangeException>(() => carService.GetOffers(0));
 }
Exemplo n.º 2
0
 public IHttpActionResult GetOffers(int id)
 {
     try
     {
         return(Ok(Mapper.Map <IEnumerable <OfferDTO>, List <OfferDetailsViewModel> >(careerService.GetOffers(id))));
     }
     catch (ArgumentOutOfRangeException ex)
     {
         return(Content(System.Net.HttpStatusCode.NoContent, ex.ParamName));
     }
 }