Ejemplo n.º 1
0
        public void GetAllTheater_ValidQuery_SuccessResult()
        {
            var theaters = new List <Theater>
            {
                new Theater {
                    Id = 1, Name = "", Status = Data.Enums.Status.NowShowing
                },
                new Theater {
                    Id = 2, Name = "", Status = Data.Enums.Status.NowShowing
                },
                new Theater {
                    Id = 3, Name = "", Status = Data.Enums.Status.NowShowing
                }
            };

            _mockTheaterRepository.Setup(x => x.FindAll(It.IsAny <Expression <Func <Theater, bool> > >())).Returns(theaters.AsQueryable());

            var theaterService = new TheaterService(_mockTheaterRepository.Object);

            var result = theaterService.GetAllTheater();

            Assert.Equal(3, result.Count);
        }