public void CallSeatServiceGetPriceWithSameParameters() { 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.GetPrice(validUsername, validId); mockedSeatService.Verify( service => service.GetPrice(validUsername, validId), Times.Once); }
public void ReturnSameValueFromSeatServiceGetPrice() { var mockedScreeningService = new Mock <IFilmScreeningService>(); var mockedSeatService = new Mock <ISeatService>(); string validId = "1"; string validUsername = "******"; string expectedString = "20"; mockedSeatService.Setup( service => service.GetPrice(validUsername, validId)) .Returns(expectedString); var actualPaymentPresenter = new Presenters.PaymentPresenters.PaymentPresenter(mockedScreeningService.Object, mockedSeatService.Object); string actualString = actualPaymentPresenter.GetPrice(validUsername, validId); Assert.AreEqual(expectedString, actualString); }