Exemplo n.º 1
0
        public void GivenInvalidShowName_WhenCallingAction_ShouldGetBadRequest(string showName)
        {
            // ARRANGE
            var controller = new CinemaController(_bookingServiceMock.Object, _cinemaShowServiceMock.Object, _seatServiceMock.Object);

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

            // ASSERT
            result.Should().NotBeNull();
            result.StatusCode.Should().Be(400);
        }
Exemplo n.º 2
0
        public void GivenNoAvailableSeats_WhenCallingAction_ShouldGetNotFound()
        {
            // ARRANGE
            _seatServiceMock.Setup(s => s.GetAvailableSeats(It.IsAny <string>())).Returns(() => null);
            var controller = new CinemaController(_bookingServiceMock.Object, _cinemaShowServiceMock.Object, _seatServiceMock.Object);

            // ACT
            var response = controller.GetAvailabelSeats(_fixture.Create <string>());
            var result   = response.Result as ObjectResult;

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