예제 #1
0
        public void ShouldFindSingleChild()
        {
            var continuation = new Continuation {Id = _job.Id};

            var match = continuation.Find(_job);

            Assert.Equal(continuation, match);
        }
예제 #2
0
        public void ShouldFindContinuationsInOnAnyFailure()
        {
            var continuation = new Continuation
            {
                Id = Guid.NewGuid(),
                OnAnyFailed = new Continuation {Id = _job.Id}
            };

            var match = continuation.Find(_job);

            Assert.Equal(continuation.OnAnyFailed, match);
        }
예제 #3
0
        public void ShouldFindNextContinuation()
        {
            var continuation = new Continuation
            {
                Id = Guid.NewGuid(),
                Next = new Continuation {Id = _job.Id}
            };

            var match = continuation.Find(_job);

            Assert.Equal(continuation.Next, match);
        }
예제 #4
0
        public void ShouldFindContinuationsInGroup()
        {
            var matchingChild = new Continuation {Id = _job.Id};

            var continuation = new Continuation
            {
                Children = new []
                {
                    new Continuation { Id = Guid.NewGuid() },
                    matchingChild
                }
            };

            var match = continuation.Find(_job);

            Assert.Equal(matchingChild, match);
        }
예제 #5
0
        public void ShouldReturnNullIfNoMatchingContinuationIsFoundAnywhere()
        {
            var continuation = new Continuation
            {
                Children = new[] {new Continuation()},
                OnAnyFailed = new Continuation(),
                OnAllFailed = new Continuation()
            };

            var match = continuation.Find(_job);

            Assert.Null(match);
        }