示例#1
0
        public static Outcome GetOutcome(OutcomeState state)
        {
            switch (state)
            {
            case OutcomeState.Canceled:
                return(Canceled);

            case OutcomeState.Completed:
                return(Completed);

            case OutcomeState.Faulted:
                return(Faulted);

            default:
                return(None);
            }
        }
        protected override void Cancel(NativeActivityContext context)
        {
            context.ScheduleActivity(_w1);
            OutcomeState outcome = this.OutcomeOnCancellation.Get(context);

            switch (outcome)
            {
            case OutcomeState.Canceled:
                base.Cancel(context);
                break;

            case OutcomeState.Completed:
                context.RemoveAllBookmarks();
                break;

            case OutcomeState.Faulted:
                throw new TestCaseException("Exception is intentionally thrown during cancellation");
            }
        }
 public TestBlockingActivityWithWriteLineInCancel(string displayName, OutcomeState outcome)
     : this(displayName)
 {
     ((BlockingActivityWithWriteLineInCancel)this.ProductActivity).OutcomeOnCancellation = new InArgument <OutcomeState>(outcome);
 }
示例#4
0
 public Outcome(OutcomeState initialOutcome, OutcomeState propogatedOutcome)
 {
     this.DefaultPropogationState = initialOutcome;
     this.propogatedOutcome       = propogatedOutcome;
 }
示例#5
0
 public Outcome(OutcomeState ExpectedOutcome)
     : this(ExpectedOutcome, ExpectedOutcome)
 {
 }