Exemplo n.º 1
0
        public void ListCinema_ShouldListCinemas()
        {
            //Arrange
            Cinema cinemaDto = new()
            {
                Adress    = "Some adress",
                City      = CityType.California,
                Name      = "Some Name",
                Rooms     = new List <Room>(),
                TimeClose = "Some Time"
            };
            Cinema cinemaDto2 = new()
            {
                Adress    = "Some adress2",
                City      = CityType.Stara_Zagora,
                Name      = "Some Name2",
                Rooms     = new List <Room>(),
                TimeClose = "Some Time2"
            };

            //Act
            _sqlCinemaService.CreateCinema(cinemaDto);
            _sqlCinemaService.CreateCinema(cinemaDto2);

            //Assert
            List <Cinema> cinemas = _sqlCinemaService.ListCinemas();

            Assert.IsNotNull(cinemas);
            Assert.IsInstanceOfType(cinemas, typeof(List <Cinema>));
            Assert.AreEqual(2, cinemas.Count);
        }

        [TestMethod]
Exemplo n.º 2
0
        public IActionResult ListCinema()
        {
            CinemaListViewModel viewModel = new();

            viewModel.Cinemas = _sqlCinemaService.ListCinemas();

            return(View(viewModel));
        }