public void Time_out_scheduling_lambda_function_can_be_customized() { var lambdaItem = new LambdaItem(_lambdaIdentity, _workflow.Object); lambdaItem.WithTimeout(i => TimeSpan.FromSeconds(10)); var swfDecision = lambdaItem.ScheduleDecisions().Single().SwfDecision(); Assert.That(swfDecision.ScheduleLambdaFunctionDecisionAttributes.StartToCloseTimeout, Is.EqualTo("10")); }
public void Invalid_argument_tests() { var lambdaItem = new LambdaItem(_lambdaIdentity, Mock.Of <IWorkflow>()); Assert.Throws <ArgumentNullException>(() => lambdaItem.WithInput(null)); Assert.Throws <ArgumentNullException>(() => lambdaItem.WithTimeout(null)); Assert.Throws <ArgumentNullException>(() => lambdaItem.OnCompletion(null)); Assert.Throws <ArgumentNullException>(() => lambdaItem.OnFailure(null)); Assert.Throws <ArgumentNullException>(() => lambdaItem.OnTimedout(null)); Assert.Throws <ArgumentNullException>(() => lambdaItem.OnSchedulingFailed(null)); Assert.Throws <ArgumentNullException>(() => lambdaItem.OnStartFailed(null)); Assert.Throws <ArgumentException>(() => lambdaItem.AfterActivity(null, "1.0")); Assert.Throws <ArgumentException>(() => lambdaItem.AfterActivity("name", null)); Assert.Throws <ArgumentException>(() => lambdaItem.AfterTimer(null)); Assert.Throws <ArgumentException>(() => lambdaItem.AfterLambda(null)); Assert.Throws <ArgumentException>(() => lambdaItem.AfterChildWorkflow(null, "ver")); Assert.Throws <ArgumentException>(() => lambdaItem.AfterChildWorkflow("name", null)); Assert.Throws <ArgumentNullException>(() => lambdaItem.When(null)); Assert.Throws <ArgumentNullException>(() => lambdaItem.When(null, _ => WorkflowAction.Empty)); Assert.Throws <ArgumentNullException>(() => lambdaItem.When(_ => true, null)); }