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

            leaf.SetStepValue("a", "1");

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

            leaf.MoveToTop(step0);

            leaf.AllSteps()[0].ShouldBeTheSameAs(step0);
            leaf.AllSteps()[1].ShouldBeTheSameAs(step1);
            leaf.AllSteps()[2].ShouldBeTheSameAs(step2);
            leaf.AllSteps()[3].ShouldBeTheSameAs(step3);
        }
コード例 #3
0
ファイル: StepLeafTester.cs プロジェクト: larsw/storyteller
        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);
        }
コード例 #4
0
ファイル: TableTester.cs プロジェクト: larsw/storyteller
        public void SetUp()
        {
            leaf = new StepLeaf();
            leaf.AddNewStep();
            leaf.AddNewStep();
            leaf.AddNewStep();
            leaf.AddNewStep();

            Cell b = Cell.For <int>("b");

            b.DefaultValue = "2";
            Cell a = Cell.For <int>("a");

            a.DefaultValue = "3";

            table = new Table("some label", "row", a, b);

            table.SetDefaultValueFor("b", leaf);
        }
コード例 #5
0
        public void add_step()
        {
            var leaf = new StepLeaf
            {
                DefaultChildStepName = "DaRow"
            };

            IStep step = leaf.AddNewStep();
            step.GrammarKey.ShouldEqual(leaf.DefaultChildStepName);
            leaf.AllSteps().Contains(step).ShouldBeTrue();
        }
コード例 #6
0
ファイル: StepLeafTester.cs プロジェクト: larsw/storyteller
        public void add_step()
        {
            var leaf = new StepLeaf
            {
                DefaultChildStepName = "DaRow"
            };

            IStep step = leaf.AddNewStep();

            step.GrammarKey.ShouldEqual(leaf.DefaultChildStepName);
            leaf.AllSteps().Contains(step).ShouldBeTrue();
        }
コード例 #7
0
        public void move_down_1()
        {
            var leaf = new StepLeaf();
            IStep step0 = leaf.AddNewStep();
            IStep step1 = leaf.AddNewStep();
            IStep step2 = leaf.AddNewStep();
            IStep step3 = leaf.AddNewStep();

            leaf.MoveDown(step0);

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

            leaf.MoveDown(step0);

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

            leaf.MoveDown(step0);

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

            leaf.MoveDown(step0);

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

            leaf.SetStepValue("a", "1");

            step0.Get("a").ShouldEqual("1");
            step1.Get("a").ShouldEqual("1");
            step2.Get("a").ShouldEqual("1");
            step3.Get("a").ShouldEqual("1");
        }
コード例 #10
0
        public void move_up_when_the_step_is_already_first()
        {
            var leaf = new StepLeaf();
            IStep step0 = leaf.AddNewStep();
            IStep step1 = leaf.AddNewStep();
            IStep step2 = leaf.AddNewStep();
            IStep step3 = leaf.AddNewStep();

            leaf.MoveUp(step0);

            leaf.AllSteps()[0].ShouldBeTheSameAs(step0);
            leaf.AllSteps()[1].ShouldBeTheSameAs(step1);
            leaf.AllSteps()[2].ShouldBeTheSameAs(step2);
            leaf.AllSteps()[3].ShouldBeTheSameAs(step3);
        }
コード例 #11
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);
        }
コード例 #12
0
ファイル: TableTester.cs プロジェクト: adymitruk/storyteller
        public void SetUp()
        {
            leaf = new StepLeaf();
            leaf.AddNewStep();
            leaf.AddNewStep();
            leaf.AddNewStep();
            leaf.AddNewStep();

            Cell b = Cell.For<int>("b");
            b.DefaultValue = "2";
            Cell a = Cell.For<int>("a");
            a.DefaultValue = "3";

            table = new Table("some label", "row", a, b);

            table.SetDefaultValueFor("b", leaf);
        }