public GetExecutionTokenStatus ( string applicationName, string taskName ) : ExecutionTokenStatus | ||
applicationName | string | |
taskName | string | |
Результат | ExecutionTokenStatus |
public void If_InUsingBlock_ThenExecutionCompletedOnEndOfBlock() { // ARRANGE var executionHelper = new ExecutionsHelper(); var taskDefinitionId = executionHelper.InsertTask(TestConstants.ApplicationName, TestConstants.TaskName); executionHelper.InsertAvailableExecutionToken(taskDefinitionId); // ACT var executionsHelper = new ExecutionsHelper(); bool startedOk; ExecutionTokenStatus tokenStatusAfterStart; ExecutionTokenStatus tokenStatusAfterUsingBlock; using (var executionContext = ClientHelper.GetExecutionContext(TestConstants.TaskName, ClientHelper.GetDefaultTaskConfigurationWithKeepAliveAndReprocessing())) { startedOk = executionContext.TryStart(); tokenStatusAfterStart = executionsHelper.GetExecutionTokenStatus(TestConstants.ApplicationName, TestConstants.TaskName); } tokenStatusAfterUsingBlock = executionsHelper.GetExecutionTokenStatus(TestConstants.ApplicationName, TestConstants.TaskName); // ASSERT Assert.AreEqual(true, startedOk); Assert.AreEqual(ExecutionTokenStatus.Unavailable, tokenStatusAfterStart); Assert.AreEqual(ExecutionTokenStatus.Available, tokenStatusAfterUsingBlock); }