BlogSharp.Core.Impl.Tests.EventHandlers.Membership.PasswordResettedEventListenerTests.Calls_template_engine_and_template_source_then_sends_email C# (CSharp) Method

Calls_template_engine_and_template_source_then_sends_email() private method

        public void Calls_template_engine_and_template_source_then_sends_email()
        {
            var author = new User {Email = "[email protected]"};
            var membershipServiceMock = MockRepository.GenerateMock<IMembershipService>();
            listener.Handle(new PasswordResettedEventArgs(membershipServiceMock, author, "1234"));
            templateSourceMock.AssertWasCalled(x => x.GetTemplateWithKey("membership_passwordreset"));
            templateEngineMock.AssertWasCalled(
                x => x.Merge(Arg<ITemplate>.Is.Anything, Arg<IDictionary<string, object>>.Is.Anything));
            mailServiceMock.AssertWasCalled(x => x.Send(
                                                 	Arg<MailAddress>.Matches(y => y.Address == "[email protected]"),
                                                 	Arg<MailAddress>.Is.Anything,
                                                 	Arg<MailAddress>.Is.Anything,
                                                 	Arg<string>.Is.Anything,
                                                 	Arg<string>.Is.Anything
                                                 	));
        }