コード例 #1
0
            public void ReturnsAnEmptyListForSimpleLoop()
            {
                var state = new SingleResultState();

                configurator.ConfigureTransition(state.Result, state);

                var looseEnds = configurator.GetAllLooseEndStateResults();

                looseEnds.Should().BeEmpty();
            }
コード例 #2
0
            public void ReturnsOneForSingleLooseEnd()
            {
                var state = new SingleResultState();

                configurator.AllDistinctStatesInOrder.Add(state);

                var looseEnds = configurator.GetAllLooseEndStateResults();

                looseEnds.Should().HaveCount(1);
            }
コード例 #3
0
            public void ReturnsAnEmptyListForSimpleTree()
            {
                var start   = new SingleResultState();
                var deadEnd = new NoResultState();

                configurator.ConfigureTransition(start.Result, deadEnd);

                var looseEnds = configurator.GetAllLooseEndStateResults();

                looseEnds.Should().BeEmpty();
            }
コード例 #4
0
            public void ReturnsTwoForLooseEndBranch()
            {
                var state1 = new SingleResultState();
                var state2 = new SingleResultState();
                var branch = new TwoResultState();

                configurator.ConfigureTransition(state1.Result, state2);
                configurator.ConfigureTransition(state2.Result, branch);

                var looseEnds = configurator.GetAllLooseEndStateResults();

                looseEnds.Should().HaveCount(2);
            }
コード例 #5
0
            public void ReturnsOneForLinearLooseEnd()
            {
                var state1 = new SingleResultState();
                var state2 = new SingleResultState();
                var state3 = new SingleResultState();

                configurator.ConfigureTransition(state1.Result, state2);
                configurator.ConfigureTransition(state2.Result, state3);

                var looseEnds = configurator.GetAllLooseEndStateResults();

                looseEnds.Should().HaveCount(1);
            }
コード例 #6
0
            public void ReturnsAnEmptyListForLongerLoop()
            {
                var state1 = new SingleResultState();
                var state2 = new SingleResultState();
                var state3 = new SingleResultState();

                configurator.ConfigureTransition(state1.Result, state2);
                configurator.ConfigureTransition(state2.Result, state3);
                configurator.ConfigureTransition(state3.Result, state1);

                var looseEnds = configurator.GetAllLooseEndStateResults();

                looseEnds.Should().BeEmpty();
            }
コード例 #7
0
            public void ReturnsTwoForDisjointLinearLooseEnds()
            {
                var start1 = new SingleResultState();
                var loose1 = new SingleResultState();
                var start2 = new SingleResultState();
                var loose2 = new SingleResultState();

                configurator.ConfigureTransition(start1.Result, loose1);
                configurator.ConfigureTransition(start2.Result, loose2);

                var looseEnds = configurator.GetAllLooseEndStateResults();

                looseEnds.Should().HaveCount(2);
            }
コード例 #8
0
            public void ReturnsOneForPartiallyLoopingBranch()
            {
                var state1 = new SingleResultState();
                var state2 = new SingleResultState();
                var branch = new TwoResultState();

                configurator.ConfigureTransition(state1.Result, state2);
                configurator.ConfigureTransition(state2.Result, branch);
                configurator.ConfigureTransition(branch.Result1, state1);

                var looseEnds = configurator.GetAllLooseEndStateResults();

                looseEnds.Should().HaveCount(1);
            }
コード例 #9
0
            public void ReturnsAnEmptyListForBranchingLoop()
            {
                var start              = new SingleResultState();
                var branch             = new TwoResultState();
                var branchContinuation = new SingleResultState();

                configurator.ConfigureTransition(start.Result, branch);
                configurator.ConfigureTransition(branch.Result1, branchContinuation);
                configurator.ConfigureTransition(branchContinuation.Result, start);
                configurator.ConfigureTransition(branch.Result2, start);

                var looseEnds = configurator.GetAllLooseEndStateResults();

                looseEnds.Should().BeEmpty();
            }