コード例 #1
0
        public void It_sets_current_item_correctly()
        {
            testContext.InitializeController(controller);
            var page = new FooPage();
            testContext.SetCurrentItem(page);

            controller.CurrentItem.Should().Be(page);
        }
コード例 #2
0
        public void AddChildren_works_as_expected()
        {
            FooPage parent, child1, child2, grandChild;

            parent = new FooPage()
                .AddChildren(
                    child1 = new FooPage(),
                    child2 = new FooPage()
                        .AddChildren(
                            grandChild = new FooPage()
                        )
                );

            parent.Should().NotBeNull();
            parent.Children.Count.Should().Be(2);
            parent.Children[1].Children.First().Should().Be(grandChild);
        }