public static LockId ( string id, TaskType type ) : ElmcityUtils.HttpResponse | ||
id | string | |
type | TaskType | |
Результат | ElmcityUtils.HttpResponse |
public void LockIdFailsWhenLockRecordExists() { var http_response = Scheduler.UnlockId(testid, test_task_type); http_response = Scheduler.LockId(testid, test_task_type); http_response = Scheduler.LockId(testid, test_task_type); Assert.AreEqual(HttpStatusCode.Conflict, http_response.status); }
public void LockIdSucceedsWhenLockRecordDoesNotExist() { var http_response = Scheduler.UnlockId(testid, test_task_type); http_response = Scheduler.LockId(testid, test_task_type); Assert.AreEqual(HttpStatusCode.Created, http_response.status); Assert.AreEqual(true, Scheduler.IsLockedId(testid, test_task_type)); }
public void IsAbandonedIfLockedAndNotRunning() { Scheduler.InitTaskForId(testid, test_task_type); var task = Scheduler.FetchTaskForId(testid, test_task_type); //task.running = false; task.status = TaskStatus.stopped; Scheduler.StoreTaskForId(task, testid, test_task_type); Scheduler.LockId(testid, test_task_type); Assert.AreEqual(true, Scheduler.IsAbandoned(testid, test_task_type)); }