コード例 #1
0
ファイル: StepLeafTester.cs プロジェクト: larsw/storyteller
        public void move_to_bottom()
        {
            var   leaf  = new StepLeaf();
            IStep step0 = leaf.AddNewStep();
            IStep step1 = leaf.AddNewStep();
            IStep step2 = leaf.AddNewStep();
            IStep step3 = leaf.AddNewStep();

            leaf.MoveToBottom(step0);

            leaf.AllSteps()[0].ShouldBeTheSameAs(step1);
            leaf.AllSteps()[1].ShouldBeTheSameAs(step2);
            leaf.AllSteps()[2].ShouldBeTheSameAs(step3);
            leaf.AllSteps()[3].ShouldBeTheSameAs(step0);

            leaf.MoveToBottom(step1);

            leaf.AllSteps()[0].ShouldBeTheSameAs(step2);
            leaf.AllSteps()[1].ShouldBeTheSameAs(step3);
            leaf.AllSteps()[2].ShouldBeTheSameAs(step0);
            leaf.AllSteps()[3].ShouldBeTheSameAs(step1);
        }
コード例 #2
0
        public void move_to_bottom_when_already_last()
        {
            var leaf = new StepLeaf();
            IStep step0 = leaf.AddNewStep();
            IStep step1 = leaf.AddNewStep();
            IStep step2 = leaf.AddNewStep();
            IStep step3 = leaf.AddNewStep();

            leaf.MoveToBottom(step3);

            leaf.AllSteps()[0].ShouldBeTheSameAs(step0);
            leaf.AllSteps()[1].ShouldBeTheSameAs(step1);
            leaf.AllSteps()[2].ShouldBeTheSameAs(step2);
            leaf.AllSteps()[3].ShouldBeTheSameAs(step3);
        }