Esempio n. 1
0
        public async Task CreateJob_ValidResult()
        {
            //Arrange
            var job = _jobMaker.CreateTestJob();

            //Act
            var result = await _persistentScheduler.ScheduleJobAsync(job);

            //Assert
            Assert.True(result.Success);
        }
        public async Task AddJob_ValidResult()
        {
            //Arrange
            var job = _jobMaker.CreateTestJob();

            //Act
            var result = await _scheduler.ScheduleJobAsync(job);

            //Assert
            Assert.True(result.Success);
            // Assert.Equal($"Job {job.Key} was successfully scheduled", result.Error);
        }
        public async Task RescheduleJob_ValidResult()
        {
            //Arrange
            var job       = _jobMaker.CreateTestJob();
            var updateJob = _jobMaker.CreateTestJob(job.Key);

            //Act
            await _persistentScheduler.ScheduleJobAsync(job);

            var result = await _persistentScheduler.RescheduleJobAsync(updateJob);

            //Assert
            Assert.True(result.Success);
            // Assert.Equal($"Job {job.Key} was successfully scheduled", message);
        }
Esempio n. 4
0
        public async Task GetJobById_ValidResult()
        {
            //Arrange
            var newJob = _jobMaker.CreateTestJob();

            //Act
            await _persistentScheduler.ScheduleJobAsync(newJob);

            var result = await _persistentScheduler.GetJob(newJob.Key);

            //Assert
            Assert.True(result.Success);
            Assert.NotNull(result.Value);
            Assert.Equal(newJob.Key, result.Value.Key);
        }
        public async Task GetJobById_ValidResult()
        {
            //Arrange
            var newJob = _jobMaker.CreateTestJob();

            //Act
            await _scheduler.ScheduleJobAsync(newJob);

            var result = await _scheduler.GetJob(newJob.Key);

            //Assert
            Assert.True(result.Success);
            Assert.NotNull(result.Value);
            // Assert.Equal($"Job: {newJob.Key} is active", message);
        }
Esempio n. 6
0
        public async Task GetJobs_ValidResult()
        {
            //Act
            await _persistentScheduler.ScheduleJobAsync(_jobMaker.CreateTestJob());

            await _persistentScheduler.ScheduleJobAsync(_jobMaker.CreateTestJob());

            await _persistentScheduler.ScheduleJobAsync(_jobMaker.CreateTestJob());

            await _persistentScheduler.ScheduleJobAsync(_jobMaker.CreateTestJob());

            await _persistentScheduler.ScheduleJobAsync(_jobMaker.CreateTestJob());

            var result = await _persistentScheduler.GetJobs();

            //Assert
            Assert.True(result.Success);
            Assert.Equal(5, result.Value.Length);
        }
Esempio n. 7
0
        public async Task GetJobs_ValidResult()
        {
            //Act
            await _scheduler.ScheduleJobAsync(_jobMaker.CreateTestJob());

            await _scheduler.ScheduleJobAsync(_jobMaker.CreateTestJob());

            await _scheduler.ScheduleJobAsync(_jobMaker.CreateTestJob());

            await _scheduler.ScheduleJobAsync(_jobMaker.CreateTestJob());

            await _scheduler.ScheduleJobAsync(_jobMaker.CreateTestJob());

            var result = await _scheduler.GetJobs();

            //Assert
            Assert.True(result.Success);
            Assert.Equal(5, result.Value.Length);
            // Assert.Equal("That's ur jobs, boy", message);
        }
Esempio n. 8
0
        public async Task DeleteJob_ValidResult()
        {
            //Arrange
            var job = _jobMaker.CreateTestJob();

            //Act
            await _scheduler.ScheduleJobAsync(job);

            var result = await _scheduler.UnscheduleJobAsync(job.Key);

            //Assert
            Assert.True(result.Success);
        }