Exemplo n.º 1
0
        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));
        }