public IActionResult Index() { var model = new HallListViewModel() { Halls = _hallService.GetAll() }; return(View(model)); }
public void ShouldCreateAndSaveHallWithSeatsInCorrectOrder() { //Arrange Hall hall = CreateHall(); //Act hallService.CreateHall(hall); //Assert IEnumerable <Hall> halls = hallService.GetAll(); List <Seat> seats = halls.First().Rows.First().Seats.ToList(); Assert.NotEmpty(halls); Assert.Single(halls); Assert.Equal("asd", halls.First().HallName); Assert.Equal(SeatStatus.Free, seats[0].Status); Assert.Equal(SeatStatus.Excluded, seats[1].Status); Assert.Equal(SeatStatus.Free, seats[2].Status); Assert.Equal(hall.Rows[0].Seats.Count, applicationDbContext.Seats.Count()); }
public ActionResult <List <Hall> > GetHalls() { return(Ok(hallService.GetAll())); }