Ejemplo n.º 1
0
        public void GivenNoCinemaShows_WhenCallGetActiveCinemaShows_ShouldGetNotFound()
        {
            // ARRANGE
            _cinemaShowServiceMock.Setup(cs => cs.GetAvailableCinemaShows()).Returns(() => null);

            var controller = new CinemaController(_bookingServiceMock.Object, _cinemaShowServiceMock.Object, _seatServiceMock.Object);

            // ACT
            var response = controller.GetAvailableCinemaShows();
            var result   = response.Result as ObjectResult;

            // ASSERT
            result.Should().NotBeNull();
            result.StatusCode.Should().Be(404);
        }
Ejemplo n.º 2
0
        public void GivenHaveCinemaShows_WhenCallGetActiveCinemaShows_ShouldGetOk()
        {
            // ARRANGE
            var shows = _fixture.Create <IEnumerable <CinemaShow> >();

            _cinemaShowServiceMock.Setup(cs => cs.GetAvailableCinemaShows()).Returns(shows);

            var controller = new CinemaController(_bookingServiceMock.Object, _cinemaShowServiceMock.Object, _seatServiceMock.Object);

            // ACT
            var response = controller.GetAvailableCinemaShows();
            var result   = response.Result as ObjectResult;

            // ASSERT
            result.Should().NotBeNull();
            result.StatusCode.Should().Be(200);
        }