public void StandaloneTerminateWorkflow() { s_exceptionType = typeof(TAC.ApplicationException); s_exceptionMsg = "I am throwing this Exception"; s_terminationReason = "Just cus!"; TestTerminateWorkflow terminateWf = new TestTerminateWorkflow("Terminating") { ExceptionExpression = ((env) => new TAC.ApplicationException("I am throwing this Exception")), Reason = s_terminationReason, }; RunTestWithWorkflowRuntime(terminateWf); }
public void VerifyValidationException() { string wfName = "TerminatingWorkflow"; TestTerminateWorkflow terminate = new TestTerminateWorkflow(wfName) { // Not setting Reason and Exception }; string exceptionMessage = string.Format(ErrorStrings.OneOfTwoPropertiesMustBeSet, "Reason", "Exception", "TerminateWorkflow", wfName); List <TestConstraintViolation> constraints = new List <TestConstraintViolation>(); constraints.Add(new TestConstraintViolation(exceptionMessage, terminate.ProductActivity, false)); TestRuntime.ValidateWorkflowErrors(terminate, constraints, exceptionMessage); }