public void Set_QueuePollInterval_ShouldThrowAnException_WhenGivenIntervalIsNegative()
        {
            var options = new FluentNHibernateStorageOptions();

            Assert.Throws <ArgumentException>(
                () => options.QueuePollInterval = TimeSpan.FromSeconds(-1));
        }
        public void Set_QueuePollInterval_SetsTheValue()
        {
            var options = new FluentNHibernateStorageOptions();

            options.QueuePollInterval = TimeSpan.FromSeconds(1);
            Assert.Equal(TimeSpan.FromSeconds(1), options.QueuePollInterval);
        }
        public void Set_QueuePollInterval_ShouldThrowAnException_WhenGivenIntervalIsEqualToZero()
        {
            var options = new FluentNHibernateStorageOptions();

            Assert.Throws <ArgumentException>(
                () => options.QueuePollInterval = TimeSpan.Zero);
        }
        public void Ctor_SetsTheDefaultOptions()
        {
            var options = new FluentNHibernateStorageOptions();

            Assert.True(options.QueuePollInterval > TimeSpan.Zero);
            Assert.True(options.InvisibilityTimeout > TimeSpan.Zero);
            Assert.True(options.JobExpirationCheckInterval > TimeSpan.Zero);
            Assert.True(options.PrepareSchemaIfNecessary);
        }
        public void Ctor_SetsTheDefaultOptions()
        {
            var options = new FluentNHibernateStorageOptions();

            Assert.True(options.QueuePollInterval > TimeSpan.Zero);

            Assert.True(options.JobExpirationCheckInterval > TimeSpan.Zero);
            Assert.True(options.UpdateSchema);
        }
예제 #6
0
        public FluentNHibernateFetchedJobTests()
        {
            _fetchedJob = new FetchedJob {
                Id = _id, JobId = JobId, Queue = Queue
            };

            var options = new FluentNHibernateStorageOptions {
                UpdateSchema = false
            };

            _storage = new Mock <FluentNHibernateJobStorage>(ConnectionUtils.GetPersistenceConfigurer(), options);
        }
예제 #7
0
        public FluentNHibernateJobQueueProvider(FluentNHibernateJobStorage storage,
                                                FluentNHibernateStorageOptions options)
        {
            if (storage == null)
            {
                throw new ArgumentNullException("storage");
            }
            if (options == null)
            {
                throw new ArgumentNullException("options");
            }

            _jobQueue      = new FluentNHibernateJobQueue(storage, options);
            _monitoringApi = new FluentNHibernateJobQueueMonitoringApi(storage);
        }
예제 #8
0
 public FluentNHibernateJobQueue(FluentNHibernateJobStorage storage, FluentNHibernateStorageOptions options)
 {
     Logger.Info("Job queue initialized");
     _storage = storage ?? throw new ArgumentNullException("storage");
     _options = options ?? throw new ArgumentNullException("options");
 }
예제 #9
0
 public FluentNHibernateStorageTests()
 {
     _options = new FluentNHibernateStorageOptions {
         UpdateSchema = false
     };
 }
 public FluentNHibernateStorageTests()
 {
     _options = new FluentNHibernateStorageOptions {
         PrepareSchemaIfNecessary = false
     };
 }
예제 #11
0
 public static FluentNHibernateJobStorage GetStorage(FluentNHibernateStorageOptions options = null)
 {
     return(new FluentNHibernateJobStorage(GetPersistenceConfigurer(), options));
 }