コード例 #1
0
        public void AppearingOnShellContentChanged()
        {
            Shell shell   = new TestShell();
            var   item    = CreateShellItem(shellContentRoute: ContentRoute, shellSectionRoute: SectionRoute, shellItemRoute: ItemRoute);
            var   section = item.SearchForRoute <ShellSection>(SectionRoute);

            var content = new ShellContent();

            section.Items.Insert(0, content);
            section.CurrentItem = content;
            shell.Items.Add(item);
            ShellLifeCycleState state = new ShellLifeCycleState(shell);

            state.AllFalse();

            Assert.AreEqual(content, section.CurrentItem);

            section.CurrentItem = shell.SearchForRoute <ShellContent>(ContentRoute);

            Assert.IsTrue(state.ContentAppearing);

            section.CurrentItem = content;

            Assert.IsFalse(state.ContentAppearing);
        }