Ejemplo n.º 1
0
        public PerformContextMock()
        {
            Connection = new Mock<IStorageConnection>();
            BackgroundJob = new BackgroundJobMock();
            CancellationToken = new Mock<IJobCancellationToken>();

            _context = new Lazy<PerformContext>(
                () => new PerformContext(Connection.Object, BackgroundJob.Object, CancellationToken.Object));
        }
Ejemplo n.º 2
0
        public PerformContextMock()
        {
            Connection        = new Mock <IStorageConnection>();
            BackgroundJob     = new BackgroundJobMock();
            CancellationToken = new Mock <IJobCancellationToken>();

            _context = new Lazy <PerformContext>(
                () => new PerformContext(Connection.Object, BackgroundJob.Object, CancellationToken.Object));
        }
        public PreserveCultureAttributeFacts()
        {
            _connection = new Mock<IStorageConnection>();

            var storage = new Mock<JobStorage>();
            var backgroundJob = new BackgroundJobMock { Id = JobId };
            var state = new Mock<IState>();

            var createContext = new CreateContext(
                storage.Object, _connection.Object, backgroundJob.Job, state.Object);
            _creatingContext = new CreatingContext(createContext);

            var performContext = new PerformContext(
                _connection.Object, backgroundJob.Object, new Mock<IJobCancellationToken>().Object);
            _performingContext = new PerformingContext(performContext);
            _performedContext = new PerformedContext(performContext, null, false, null);
        }
Ejemplo n.º 4
0
        public PreserveCultureAttributeFacts()
        {
            _connection = new Mock <IStorageConnection>();

            var storage       = new Mock <JobStorage>();
            var backgroundJob = new BackgroundJobMock {
                Id = JobId
            };
            var state = new Mock <IState>();

            var createContext = new CreateContext(
                storage.Object, _connection.Object, backgroundJob.Job, state.Object);

            _creatingContext = new CreatingContext(createContext);

            var performContext = new PerformContext(
                _connection.Object, backgroundJob.Object, new Mock <IJobCancellationToken>().Object);

            _performingContext = new PerformingContext(performContext);
            _performedContext  = new PerformedContext(performContext, null, false, null);
        }
Ejemplo n.º 5
0
        public ApplyStateContextMock()
        {
            Storage = new Mock<JobStorage>();
            Connection = new Mock<IStorageConnection>();
            Transaction = new Mock<IWriteOnlyTransaction>();
            BackgroundJob = new BackgroundJobMock();
            NewState = new Mock<IState>();
            OldStateName = null;
            JobExpirationTimeout = TimeSpan.FromMinutes(1);

            _context = new Lazy<ApplyStateContext>(
                () => new ApplyStateContext(
                    Storage.Object,
                    Connection.Object,
                    Transaction.Object,
                    BackgroundJob.Object,
                    NewStateObject ?? NewState.Object,
                    OldStateName)
                {
                    JobExpirationTimeout = JobExpirationTimeout
                });
        }
Ejemplo n.º 6
0
        public ApplyStateContextMock()
        {
            Storage              = new Mock <JobStorage>();
            Connection           = new Mock <IStorageConnection>();
            Transaction          = new Mock <IWriteOnlyTransaction>();
            BackgroundJob        = new BackgroundJobMock();
            NewState             = new Mock <IState>();
            OldStateName         = null;
            JobExpirationTimeout = TimeSpan.FromMinutes(1);

            _context = new Lazy <ApplyStateContext>(
                () => new ApplyStateContext(
                    Storage.Object,
                    Connection.Object,
                    Transaction.Object,
                    BackgroundJob.Object,
                    NewStateObject ?? NewState.Object,
                    OldStateName)
            {
                JobExpirationTimeout = JobExpirationTimeout
            });
        }