public FluentNHibernateMonitoringApiTests()
        {
            var persistenceConfigurer = ConnectionUtils.GetPersistenceConfigurer();


            var persistentJobQueueMonitoringApiMock = new Mock <IPersistentJobQueueMonitoringApi>();

            persistentJobQueueMonitoringApiMock.Setup(m => m.GetQueues()).Returns(new[] { "default" });

            var defaultProviderMock = new Mock <IPersistentJobQueueProvider>();

            defaultProviderMock.Setup(m => m.GetJobQueueMonitoringApi())
            .Returns(persistentJobQueueMonitoringApiMock.Object);

            var storageMock = new Mock <FluentNHibernateJobStorage>(persistenceConfigurer);

            storageMock
            .Setup(m => m.QueueProviders)
            .Returns(new PersistentJobQueueProviderCollection(defaultProviderMock.Object));

            _storage   = storageMock.Object;
            _sut       = new FluentNHibernateMonitoringApi(_storage);
            _createdAt = _storage.UtcNow;
            _expireAt  = _storage.UtcNow.AddMinutes(1);
        }
Exemple #2
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);
        }