Esempio n. 1
0
        public void ConfirmBooking_MockingThroughRhinoMocks_SendCalledOnEmailService()
        {
            var mockedEmailService = MockRepository.GenerateMock<IEmailService>();
            var bookingComponent = new BookingComponent(mockedEmailService);

            var booking = new Booking();
            var person = new Person();

            bookingComponent.ConfirmBooking(booking, person);

            mockedEmailService.AssertWasCalled(service => service.Send(Arg<Email>.Is.Anything));
        }
Esempio n. 2
0
        public void ConfirmBooking_ManualMocking_SendCalledOnEmailService()
        {
            var mockedEmailService = new FakeEmailService();
            var bookingComponent = new BookingComponent(mockedEmailService);

            var booking = new Booking();
            var person = new Person();

            bookingComponent.ConfirmBooking(booking, person);

            Assert.IsTrue(mockedEmailService.SendIsExecuted);
        }