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());
        }
Beispiel #3
0
 public CinemaConsole(CinemaLogic cinema)
 {
     _cinema = cinema;
 }
 private static void Init()
 {
     //_repository = new Repository(new XmlDataBase(@"Data\XmlDB\"));
     _cinemaLogic   = new CinemaLogic(new CinemaDataContext());
     _cinemaConsole = new CinemaConsole(_cinemaLogic);
 }
 private static void Init()
 {
     _repository    = new Repository(new XmlDataBase(@"Data\XmlDB\")); //new FileDataBase(@"Data\XmlDB\");
     _cinemaLogic   = new CinemaLogic(_repository);
     _cinemaConsole = new CinemaConsole(_cinemaLogic);
 }
 public CinemaConsole(CinemaLogic cinema)
 {
     _cinema = cinema;
 }
Beispiel #7
0
 private static void Init()
 {
     _repository = new Repository(new XmlDataBase(@"Data\XmlDB\"));
     _cinemaLogic = new CinemaLogic(_repository);
     _cinemaConsole = new CinemaConsole(_cinemaLogic);
 }