Exemplo n.º 1
0
        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);
        }
Exemplo n.º 2
0
        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"));
        }
Exemplo n.º 3
0
        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));
        }
Exemplo n.º 4
0
        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 + "\""));
        }
Exemplo n.º 5
0
        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));
        }
Exemplo n.º 6
0
        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\""));
        }