Ejemplo n.º 1
0
        public void UpdateResortSuccessful()
        {
            mockMapper.Setup(x => x.Map <Resort>(It.IsAny <ResortUpdateRequest>())).Returns(fixture.Resort);

            mockUnit.Setup(x => x.Resorts.Update(It.IsAny <Resort>()));
            mockUnit.Setup(x => x.Save());

            service.UpdateResort(fixture.ResortUpdateRequest);

            mockMapper.VerifyAll();
            mockUnit.VerifyAll();
        }
 public IHttpActionResult UpdateResort(ResortUpdateRequest request)
 {
     if (!ModelState.IsValid)
     {
         return(BadRequest(ModelState));
     }
     resortService.UpdateResort(request);
     return(StatusCode(HttpStatusCode.NoContent));
 }