public void GetCinemas_With_Result() { //arrange Mock <CinemaMapper> cinemaMapper = new Mock <CinemaMapper>(); Mock <IUnitOfWork> unitOfWork = new Mock <IUnitOfWork>(); CinemaLogic cinemaLogic = new CinemaLogic(unitOfWork.Object, cinemaMapper.Object); unitOfWork.Setup(p => p.cinemaRepository.Get(null, null, "")).Returns(_GetCinemas().AsEnumerable()); //act var cinemas = cinemaLogic.GetCinemas(); //assert Assert.NotNull(cinemas); Assert.Equal(2, cinemas.Count()); }
public void GetCinemas_With_Empty_Result() { //arrange Mock <CinemaMapper> cinemaMapper = new Mock <CinemaMapper>(); Mock <IUnitOfWork> unitOfWork = new Mock <IUnitOfWork>(); CinemaLogic cinemaLogic = new CinemaLogic(unitOfWork.Object, cinemaMapper.Object); IEnumerable <Cinema.Model.Entity.Cinema> cinemaList = new List <Cinema.Model.Entity.Cinema>(); unitOfWork.Setup(p => p.cinemaRepository.Get(null, null, "")) .Returns(cinemaList); //act var cinemas = cinemaLogic.GetCinemas(); //assert Assert.NotNull(cinemas); Assert.Equal(0, cinemas.Count()); }