public void checkOwnerInfo() { BenchmarkDBEntities dbContent = new BenchmarkDBEntities(); Owner ow = new Owner("testOwner"); int owId = ow.id; var result = from user in dbContent.DB_userSet where user.userId == owId select user; DB_userSet resultUser = result.First(); Assert.AreEqual(resultUser.name, "testOwner"); }
public void addJob() { BenchmarkDBEntities dbContent = new BenchmarkDBEntities(); Job testJob = new Job(1, 10, new Owner("TestOwner"), s => "Hello world"); int jobId = testJob.id; var result = from job in dbContent.DB_JobLogSet where job.job_jobId == jobId select job.DB_JobSet; DB_JobSet resultJob = result.First(); Assert.AreEqual(jobId, resultJob.jobId); }
public void cancelJob() { BenchmarkDBEntities dbContent = new BenchmarkDBEntities(); Job testJob = new Job(1, 10, new Owner("TestOwner"), s => "Hello world"); int jobId = testJob.id; BenchmarkSystem.BenchmarkSystem bs = new BenchmarkSystem.BenchmarkSystem(); bs.submit(testJob); bs.cancel(testJob); var result = from job in dbContent.DB_JobSet where job.jobId == jobId select job; DB_JobSet resultJob = result.First(); Assert.AreEqual("CANCELLED", resultJob.status); }
public void checkStateChange() { BenchmarkDBEntities dbContent = new BenchmarkDBEntities(); Job testJob = new Job(1, 10, new Owner("TestOwner"), s => "Hello world"); int jobId = testJob.id; BenchmarkSystem.BenchmarkSystem bs = new BenchmarkSystem.BenchmarkSystem(); bs.submit(testJob); bs.executeAll(); var result = from job in dbContent.DB_JobLogSet where job.job_jobId == jobId select job.DB_JobSet; DB_JobSet resultJob = result.First(); Assert.AreEqual("DONE", resultJob.status); }
public void checkJobInfo() { using (var dbContent = new BenchmarkDBEntities()) { Owner ow = new Owner("TestAnders"); int owId = ow.id; Job testJob = new Job(1, 10, ow, s => "Hello world"); int jobId = testJob.id; var result = from job in dbContent.DB_JobSet where job.jobId == jobId select job; DB_JobSet resultJob = result.First(); Assert.AreEqual("WAITING", resultJob.status); Assert.AreEqual(resultJob.user_userId, owId); Assert.AreEqual(resultJob.jobId, jobId); } }