public GetExecutionTokens ( string applicationName, string taskName ) : |
||
applicationName | string | |
taskName | string | |
Результат |
public void If_KeepAliveMode_TwoUnavailableTokensExistsAndConcurrencyLimitIsOne_ThenRemoveOneUnavailableToken() { // ARRANGE var executionHelper = new ExecutionsHelper(); var taskDefinitionId = executionHelper.InsertTask(TestConstants.ApplicationName, TestConstants.TaskName); executionHelper.InsertExecutionToken(taskDefinitionId, new List<Tuple<ExecutionTokenStatus, string>>() { new Tuple<ExecutionTokenStatus, string>(ExecutionTokenStatus.Unavailable, "0"), new Tuple<ExecutionTokenStatus, string>(ExecutionTokenStatus.Unavailable, "1") }); var startRequest = CreateKeepAliveStartRequest(1); // ACT var sut = CreateSut(); sut.Start(startRequest); // ASSERT var tokensList = executionHelper.GetExecutionTokens(TestConstants.ApplicationName, TestConstants.TaskName); Assert.AreEqual(1, tokensList.Tokens.Count(x => x.Status == ExecutionTokenStatus.Unavailable)); }
public void If_KeepAliveMode_OneTokenExistsAndConcurrencyLimitIsUnlimited_ThenRemoveAvailableTokenAndCreateOneNewUnlimitedToken() { // ARRANGE var executionHelper = new ExecutionsHelper(); var taskDefinitionId = executionHelper.InsertTask(TestConstants.ApplicationName, TestConstants.TaskName); executionHelper.InsertAvailableExecutionToken(taskDefinitionId); var startRequest = CreateKeepAliveStartRequest(-1); // ACT var sut = CreateSut(); sut.Start(startRequest); // ASSERT var tokensList = executionHelper.GetExecutionTokens(TestConstants.ApplicationName, TestConstants.TaskName); Assert.AreEqual(1, tokensList.Tokens.Count(x => x.Status == ExecutionTokenStatus.Unlimited)); }