示例#1
0
        public async Task Hide_Nested_ToolBar(string platformName)
        {
            var platform = GetPlatform(platformName);

            using (var newApplication = platform.NewApplication <HideToolBarModule>()){
                newApplication.Title = nameof(Hide_Nested_ToolBar);
                var nestedFrame = new NestedFrame(newApplication, TemplateContext.NestedFrame, null, new List <Controller>());
                nestedFrame.CreateTemplate();
                if (platform == Platform.Web)
                {
                    nestedFrame.Template.GetMock().As <ISupportActionsToolbarVisibility>()
                    .Setup(visibility => visibility.SetVisible(false));
                }
                await nestedFrame.ReturnObservable().HideToolBar();

                if (platform == Platform.Win)
                {
                    ((IBarManagerHolder)nestedFrame.Template).BarManager.Bars.Any(bar => bar.Visible).ShouldBe(false);
                }
                else
                {
                    nestedFrame.Template.GetMock().Verify();
                }
            }
        }
        internal void Hide_Nested_ToolBar(Platform platform)
        {
            var nestedFrame = new NestedFrame(platform.NewApplication(), TemplateContext.NestedFrame, null, new List <Controller>());

            nestedFrame.CreateTemplate();
            if (platform == Platform.Web)
            {
                nestedFrame.Template.GetMock().As <ISupportActionsToolbarVisibility>()
                .Setup(visibility => visibility.SetVisible(false));
            }
            nestedFrame.HideToolBar();

            if (platform == Platform.Win)
            {
                ((IBarManagerHolder)nestedFrame.Template).BarManager.Bars.Any(bar => bar.Visible).ShouldBe(false);
            }
            else
            {
                nestedFrame.Template.GetMock().Verify();
            }
        }