コード例 #1
0
        protected override void Establish_context()
        {
            ConfigurationProvider = Create.New.StubbedEventPluginConfiguration().Build();
            MockRepository.GenerateMock <IEventPluginConfigurationProvider>();
            _settings = MockRepository.GenerateMock <IGraffitiSiteSettings>();
            _settings.Stub(x => x.Title).Return("The site's title");

            _sut = new CalendarItemRepository(ConfigurationProvider,
                                              _settings);

            _settings.Stub(x => x.BaseUrl).Return("http://foo");
        }
コード例 #2
0
		public EventPluginMemento(IEventPluginConfigurationProvider source)
		{
			SpeakerField = source.SpeakerField;
			EndDateField = source.EndDateField;
			LocationField = source.LocationField;
			StartDateField = source.StartDateField;
			LocationUnknownField = source.LocationUnknownField;
			RegistrationNeededField = source.RegistrationNeededField;
			RegistrationRecipientField = source.RegistrationRecipientField;
			MaximumNumberOfRegistrationsField = source.MaximumNumberOfRegistrationsField;
			RegistrationListField = source.RegistrationListField;
			CategoryName = source.CategoryName;
			EarliestRegistrationField = source.EarliestRegistrationField;
			LatestRegistrationField = source.LatestRegistrationField;
		}
コード例 #3
0
 public EventPluginMemento(IEventPluginConfigurationProvider source)
 {
     SpeakerField                      = source.SpeakerField;
     EndDateField                      = source.EndDateField;
     LocationField                     = source.LocationField;
     StartDateField                    = source.StartDateField;
     LocationUnknownField              = source.LocationUnknownField;
     RegistrationNeededField           = source.RegistrationNeededField;
     RegistrationRecipientField        = source.RegistrationRecipientField;
     MaximumNumberOfRegistrationsField = source.MaximumNumberOfRegistrationsField;
     RegistrationListField             = source.RegistrationListField;
     CategoryName                      = source.CategoryName;
     EarliestRegistrationField         = source.EarliestRegistrationField;
     LatestRegistrationField           = source.LatestRegistrationField;
 }
コード例 #4
0
        public EventValidator(IEventPluginConfigurationProvider config)
        {
            RequireValidDateRangeWithOptionalValues(config.StartDateField, config.EndDateField);
            If(x => x[config.EndDateField].HasValue() && !x[config.StartDateField].HasValue())
            .AddNotification(EventErrors.StartDateIsRequiredWhenEndDateIsSet(config.StartDateField));

            RequireValidDateRangeWithOptionalValues(config.EarliestRegistrationField, config.LatestRegistrationField);

            If(x => x[config.MaximumNumberOfRegistrationsField].HasValue() &&
               !x[config.MaximumNumberOfRegistrationsField].ToInt(int.MinValue).IsInRange(0, int.MaxValue))
            .AddNotification(
                EventErrors.MaximumNumberOfRegistrationsMustBeEqualOrGreaterThanZero(config.MaximumNumberOfRegistrationsField));

            If(x => x[config.RegistrationRecipientField].HasValue() &&
               !x[config.RegistrationRecipientField].IsEmail())
            .AddNotification(EventErrors.InvalidRegistrationRecipientEmail(config.RegistrationRecipientField));
        }
コード例 #5
0
 public EventBuilder(IEventPluginConfigurationProvider configurationProvider)
 {
     _config = configurationProvider;
 }
コード例 #6
0
		protected override void Establish_context()
		{
			ConfigurationProvider = Create.New.StubbedEventPluginConfiguration().Build();
			MockRepository.GenerateMock<IEventPluginConfigurationProvider>();
			_settings = MockRepository.GenerateMock<IGraffitiSiteSettings>();
			_settings.Stub(x => x.Title).Return("The site's title");

			_sut = new CalendarItemRepository(ConfigurationProvider,
			                                  _settings);

			_settings.Stub(x => x.BaseUrl).Return("http://foo");
		}
コード例 #7
0
 public CalendarItemRepository(IEventPluginConfigurationProvider eventPluginConfigurationProvider,
                               IGraffitiSiteSettings settings)
 {
     _eventPluginConfigurationProvider = eventPluginConfigurationProvider;
     _settings = settings;
 }
コード例 #8
0
		public CalendarItemRepository(IEventPluginConfigurationProvider eventPluginConfigurationProvider,
		                              IGraffitiSiteSettings settings)
		{
			_eventPluginConfigurationProvider = eventPluginConfigurationProvider;
			_settings = settings;
		}