コード例 #1
0
        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);
        }
コード例 #2
0
        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);
        }