Esempio n. 1
0
        public ActionResult <ICollection <SportDTO> > GetAllSports()
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest(ModelState));
            }

            try
            {
                var sports = mapper.Map <SportDTO[]>(sportBusinessLogic.GetAll());
                return(Ok(sports));
            }
            catch (Exception e)
            {
                return(StatusCode(500, e.Message));
            }
        }
 public void GetAllTest()
 {
     sportBL.GetAll();
     mockSportRepo.Verify(x => x.Get(null, null, It.IsAny <string>()), Times.Once());
 }