public async void UpdateBlock_ShowsCorrectView() { bookingRepository.Setup(r => r.GetByIdAsync(1)).ReturnsAsync(BookingGenerator.CreateBlock()); var result = await Controller.EditBlockFacility(1); Assert.IsType <ViewResult>(result); var viewResult = result as ViewResult; Assert.Null(viewResult.ViewName); }
public async void UpdateBlock_ContainsCorrectModel() { var expectedResource = BookingGenerator.CreateBlock(); bookingRepository.Setup(r => r.GetByIdAsync(1)).ReturnsAsync(expectedResource); var viewResult = await Controller.EditBlockFacility(1) as ViewResult; Assert.IsType <Booking>(viewResult.Model); var resources = viewResult.Model as Booking; Assert.Equal(expectedResource, resources); }