Exemplo n.º 1
0
        public IActionResult CinemaDetail(int id)
        {
            Cinema cinema = _sqlCinemaService.GetCinema(id);

            CinemaDetailsModel viewModel = new();

            viewModel.Rooms     = _sqlCinemaService.ListRooms(cinema);
            viewModel.TimeClose = cinema.TimeClose;
            viewModel.Name      = cinema.Name;

            return(View(viewModel));
        }
Exemplo n.º 2
0
        public void DeleteCinema_ShouldDelete()
        {
            //Arrange
            Cinema cinemaDto = new()
            {
                Adress    = "Some adress",
                City      = CityType.California,
                Name      = "Some Name",
                Rooms     = new List <Room>(),
                TimeClose = "Some Time"
            };

            //Act
            _sqlCinemaService.CreateCinema(cinemaDto);

            _sqlCinemaService.DeleteCinema(cinemaDto);

            //Assert
            Cinema cinema = _sqlCinemaService.GetCinema(cinemaDto.Id);

            Assert.IsNull(cinema);
        }