public override IHttpResponse Execute()
        {
            IEnumerable <INotification> validationErrors = Validator.Validate(this);

            if (validationErrors.Any())
            {
                return(new ValidationErrorResult(validationErrors));
            }

            return(EventRegistrationService.RegisterForEvents(this));
        }
        protected override void Establish_context()
        {
            base.Establish_context();

            Repository = MockRepository.GenerateMock <ICategorizedPostRepository <IEventPluginConfigurationProvider> >();
            Repository.Stub(x => x.Configuration).Return(Create.New.StubbedEventPluginConfiguration().Build());

            EmailSender = MockRepository.GenerateMock <IEmailSender>();

            EmailContext = MockRepository.GenerateMock <IGraffitiEmailContext>();
            Clock        = MockRepository.GenerateStub <IClock>();
            _sut         = new EventRegistrationService(Repository,
                                                        EmailContext,
                                                        EmailSender,
                                                        "template.view",
                                                        Clock);

            Command = CreateCommand();

            _request = new HttpSimulator().SimulateRequest();
        }
 public EventsController(EventRegistrationService eventRegistrationService)
 {
     _eventRegistrationService = eventRegistrationService;
 }