public void AddWorkerShouldCreateJob() { string name = MethodBase.GetCurrentMethod().Name; JobConductorService fm = GetTestJobConductor(name); string jobName = "Job_".RandomLetters(4); Expect.IsFalse(fm.JobExists(jobName)); fm.AddWorker(typeof(TestWorker).AssemblyQualifiedName, "worker", jobName); Expect.IsTrue(fm.JobExists(jobName)); }
public void GetJobShouldCreateNewJob() { string name = MethodBase.GetCurrentMethod().Name; JobConductorService fm = GetTestJobConductor(name); Expect.IsFalse(fm.JobExists(name)); JobConf validate = fm.GetJob(name); Expect.IsNotNull(validate); Expect.AreEqual(name, validate.Name); Expect.IsTrue(fm.JobExists(validate.Name)); Expect.IsTrue(File.Exists(validate.GetFilePath())); }
public void GetJobShouldReturnExistingJob() { string name = MethodBase.GetCurrentMethod().Name; JobConductorService orch = GetTestJobConductor(name); Expect.IsFalse(orch.JobExists(name)); JobConf conf = orch.CreateJob(name); Expect.IsTrue(orch.JobExists(name)); JobConf validate = orch.GetJobConf(name); Expect.IsNotNull(validate); Expect.AreEqual(name, validate.Name); }
public void ExistsShouldBeTrueAfterCreate() { string name = MethodBase.GetCurrentMethod().Name; JobConductorService fm = GetTestJobConductor(name); string testJobName = name + "_JobName_".RandomLetters(4); fm.CreateJob(testJobName); Expect.IsTrue(fm.JobExists(testJobName)); }
public void CreateJobShouldThrowExceptionIfItExists() { string name = MethodBase.GetCurrentMethod().Name; JobConductorService fm = GetTestJobConductor(name); string testJobName = name + "_JobName_".RandomLetters(4); fm.CreateJob(testJobName); Expect.IsTrue(fm.JobExists(testJobName)); Expect.Throws(() => { fm.CreateJob(testJobName); }, "Should have thrown an exception but didn't"); }