LockId() публичный статический Метод

public static LockId ( string id, TaskType type ) : ElmcityUtils.HttpResponse
id string
type TaskType
Результат ElmcityUtils.HttpResponse
Пример #1
0
        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);
        }
Пример #2
0
        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));
        }
Пример #3
0
        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));
        }