Exemple #1
0
        public void SetUp()
        {
            mocker = AutoMock.GetLoose();
            job    = new JobModel
            {
                Id               = 123,
                Ukprn            = 4321,
                AcademicYear     = 1920,
                CollectionPeriod = 10,
                DcJobId          = 456,
                JobType          = JobType.PeriodEndStartJob,
                StartTime        = DateTimeOffset.UtcNow,
                LearnerCount     = 100,
                Status           = JobStatus.InProgress
            };
            mocker.Mock <IJobsDataContext>()
            .Setup(dc => dc.GetJobByDcJobId(456))
            .ReturnsAsync(job);
            mocker.Mock <IJobStatusConfiguration>()
            .Setup(cfg => cfg.TimeToPauseBetweenChecks).Returns(TimeSpan.FromMilliseconds(10));
            mocker.Mock <IJobStatusConfiguration>()
            .Setup(cfg => cfg.TimeToWaitForJobToComplete).Returns(TimeSpan.FromSeconds(1));

            sut = mocker.Create <JobStatusService>();
        }
Exemple #2
0
        static void Main()
        {
            JobStatusService service = new JobStatusService();

            service.Initialize();
        }
 public void SetUp()
 {
     this.jobStatusRepository = new Mock <IJobStatusRepository>();
     this.jobStatusService    = new JobStatusService(this.jobStatusRepository.Object);
 }
Exemple #4
0
 private Printer()
 {
     notifier = JobStatusService.GetInstance();
 }