public async Task CheckIfGetViewModelByIdAsyncWorksCorrectly() { this.SeedDatabase(); await this.SeedSeats(); var expectedModel = new SeatDetailsViewModel { Id = this.firstSeat.Id, RowNumber = this.firstSeat.RowNumber, Number = this.firstSeat.Number, IsAvailable = this.firstSeat.IsAvailable, IsSold = this.firstSeat.IsSold, Category = this.firstSeat.Category, }; var viewModel = await this.seatsService.GetViewModelByIdAsync <SeatDetailsViewModel>(this.firstSeat.Id); expectedModel.Hall = viewModel.Hall; var expectedObj = JsonConvert.SerializeObject(expectedModel); var actualResultObj = JsonConvert.SerializeObject(viewModel); Assert.Equal(expectedObj, actualResultObj); }
public async Task <IActionResult> Remove(SeatDetailsViewModel seatDetailsViewModel) { await this.seatsService.DeleteByIdAsync(seatDetailsViewModel.Id); return(this.RedirectToAction("GetAll", "Seats", new { area = "Administration" })); }