public void By_default_timeout_of_lamdba_fuction_is_null() { var lambdaItem = new LambdaItem(_lambdaIdentity, _workflow.Object); var swfDecision = lambdaItem.ScheduleDecisions().Single().SwfDecision(); Assert.That(swfDecision.ScheduleLambdaFunctionDecisionAttributes.StartToCloseTimeout, Is.Null); }
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 Does_not_put_json_string_in_quotes() { var workflow = new Mock <IWorkflow>(); const string workflowInput = "{\"Id\":\"10\"}"; workflow.SetupGet(w => w.WorkflowHistoryEvents).Returns(new WorkflowHistoryEvents(_builder.WorkflowStartedGraph(workflowInput))); var lambdaItem = new LambdaItem(_lambdaIdentity, workflow.Object); var decisions = lambdaItem.ScheduleDecisions(); var swfDecision = decisions.Single().SwfDecision(); Assert.That(swfDecision.ScheduleLambdaFunctionDecisionAttributes.Input, Is.EqualTo(workflowInput)); }
public void Enclose_the_lambda_input_string_if_it_is_already_not() { var workflow = new Mock <IWorkflow>(); const string workflowInput = "actvity"; workflow.SetupGet(w => w.WorkflowHistoryEvents).Returns(new WorkflowHistoryEvents(_builder.WorkflowStartedGraph(workflowInput))); var lambdaItem = new LambdaItem(_lambdaIdentity, workflow.Object); var decisions = lambdaItem.ScheduleDecisions(); var swfDecision = decisions.Single().SwfDecision(); Assert.That(swfDecision.ScheduleLambdaFunctionDecisionAttributes.Input, Is.EqualTo("\"" + workflowInput + "\"")); }
public void By_default_lambda_function_is_scheduled_with_workflow_input() { var workflow = new Mock <IWorkflow>(); const string workflowInput = "\"actvity\""; workflow.SetupGet(w => w.WorkflowHistoryEvents).Returns(new WorkflowHistoryEvents(_builder.WorkflowStartedGraph(workflowInput))); var lambdaItem = new LambdaItem(_lambdaIdentity, workflow.Object); var decisions = lambdaItem.ScheduleDecisions(); var swfDecision = decisions.Single().SwfDecision(); Assert.That(swfDecision.ScheduleLambdaFunctionDecisionAttributes.Input, Is.EqualTo(workflowInput)); }
public void Input_of_lambda_function_can_be_customized() { var workflow = new Mock <IWorkflow>(); const string workflowInput = "actvity"; workflow.SetupGet(w => w.WorkflowHistoryEvents).Returns(new WorkflowHistoryEvents(_builder.WorkflowStartedGraph(workflowInput))); var lambdaItem = new LambdaItem(_lambdaIdentity, workflow.Object); lambdaItem.WithInput(i => "CustomInput"); var decisions = lambdaItem.ScheduleDecisions(); var swfDecision = decisions.Single().SwfDecision(); Assert.That(swfDecision.ScheduleLambdaFunctionDecisionAttributes.Input, Is.EqualTo("\"CustomInput\"")); }