예제 #1
0
        public void CallSeatServiceGetUserBookedSeatsCountByScreeningIdWithSameId()
        {
            var    mockedScreeningService = new Mock <IFilmScreeningService>();
            var    mockedSeatService      = new Mock <ISeatService>();
            string validId       = "1";
            string validUsername = "******";

            var actualPaymentPresenter =
                new Presenters.PaymentPresenters.PaymentPresenter(mockedScreeningService.Object, mockedSeatService.Object);

            actualPaymentPresenter.GetUserBookedSeatsCountByScreeningId(validUsername, validId);

            mockedSeatService.Verify(service => service.GetUserBookedSeatsCountByScreeningId(validUsername, validId), Times.Once);
        }
예제 #2
0
        public void ReturnSameValueFromSeatServiceGetUserBookedSeatsCountByScreening()
        {
            var mockedScreeningService = new Mock <IFilmScreeningService>();
            var mockedSeatService      = new Mock <ISeatService>();

            string validId       = "1";
            string validUsername = "******";
            int    expectedCount = 5;

            mockedSeatService.Setup(
                service => service.GetUserBookedSeatsCountByScreeningId(validUsername, validId))
            .Returns(expectedCount);

            var actualPaymentPresenter =
                new Presenters.PaymentPresenters.PaymentPresenter(mockedScreeningService.Object, mockedSeatService.Object);

            int actualCount = actualPaymentPresenter.GetUserBookedSeatsCountByScreeningId(validUsername, validId);

            Assert.AreEqual(expectedCount, actualCount);
        }