Пример #1
0
        public async Task CheckIfGetHallViewModelByIdAsyncWorksCorrectly()
        {
            this.SeedDatabase();

            var expectedModel = new HallDetailsViewModel
            {
                Id       = this.firstHall.Id,
                Category = this.firstHall.Category,
                Capacity = this.firstHall.Capacity,
            };

            var viewModel = await this.hallsService.GetViewModelByIdAsync <HallDetailsViewModel>(this.firstHall.Id);

            var expectedObj     = JsonConvert.SerializeObject(expectedModel);
            var actualResultObj = JsonConvert.SerializeObject(viewModel);

            Assert.Equal(expectedObj, actualResultObj);
        }
Пример #2
0
        public async Task <IActionResult> Remove(HallDetailsViewModel hallDetailsViewModel)
        {
            await this.hallsService.DeleteByIdAsync(hallDetailsViewModel.Id);

            return(this.RedirectToAction("GetAll", "Halls", new { area = "Administration" }));
        }