Пример #1
0
        public void Invalid_arguments()
        {
            var childWorkflowItem = new ChildWorkflowItem(_identity, _workflow.Object);

            Assert.Throws <ArgumentNullException>(() => childWorkflowItem.OnCompletion(null));
            Assert.Throws <ArgumentNullException>(() => childWorkflowItem.OnFailure(null));
            Assert.Throws <ArgumentNullException>(() => childWorkflowItem.OnCancelled(null));
            Assert.Throws <ArgumentNullException>(() => childWorkflowItem.OnTerminated(null));
            Assert.Throws <ArgumentNullException>(() => childWorkflowItem.OnTimedout(null));
            Assert.Throws <ArgumentNullException>(() => childWorkflowItem.OnStartFailed(null));
            Assert.Throws <ArgumentNullException>(() => childWorkflowItem.WithInput(null));
            Assert.Throws <ArgumentNullException>(() => childWorkflowItem.WithChildPolicy(null));
            Assert.Throws <ArgumentNullException>(() => childWorkflowItem.WithLambdaRole(null));
            Assert.Throws <ArgumentNullException>(() => childWorkflowItem.OnTaskList(null));
            Assert.Throws <ArgumentNullException>(() => childWorkflowItem.WithPriority(null));
            Assert.Throws <ArgumentNullException>(() => childWorkflowItem.WithTimeouts(null));
            Assert.Throws <ArgumentNullException>(() => childWorkflowItem.WithTags(null));
            Assert.Throws <ArgumentNullException>(() => childWorkflowItem.When(null));
            Assert.Throws <ArgumentNullException>(() => childWorkflowItem.When(null, _ => WorkflowAction.Empty));
            Assert.Throws <ArgumentNullException>(() => childWorkflowItem.When(_ => true, null));

            Assert.Throws <ArgumentException>(() => childWorkflowItem.AfterTimer(null));
            Assert.Throws <ArgumentException>(() => childWorkflowItem.AfterActivity(null, "v"));
            Assert.Throws <ArgumentException>(() => childWorkflowItem.AfterActivity("n", null));
            Assert.Throws <ArgumentException>(() => childWorkflowItem.AfterLambda(null));
            Assert.Throws <ArgumentException>(() => childWorkflowItem.AfterChildWorkflow(null, "1.0"));
            Assert.Throws <ArgumentException>(() => childWorkflowItem.AfterChildWorkflow("n", null));
        }