public void AddWindow() { var app = new TestApp(); var window = app.CreateWindow(); ValidateSetup(app); }
public void CreateWindowOverlayAndElements() { var app = new TestApp(); var window = app.CreateWindow() as IWindow; app.LoadPage(new ContentPage()); var windowOverlay = new WindowOverlay(window) as IWindowOverlay; // First time inserted, should be true. Assert.True(window.AddOverlay(windowOverlay)); var element = new TestWindowElement(); // Adding element for the first time, should be true. Assert.True(windowOverlay.AddWindowElement(element)); Assert.True(windowOverlay.WindowElements.Count > 0); // Can't add same element again, should be false. Assert.False(windowOverlay.AddWindowElement(element)); // First time removing element, should be true. Assert.True(windowOverlay.RemoveWindowElement(element)); Assert.True(windowOverlay.WindowElements.Count == 0); }
public void ContentPageFlowDirectionSetsOnIWindow() { var app = new TestApp(); var window = app.CreateWindow(); window.Page.FlowDirection = FlowDirection.RightToLeft; Assert.IsTrue((window as IWindow) .FlowDirection == FlowDirection.RightToLeft); }
public void WindowFlowDirectionSetsOnPage() { var app = new TestApp(); var window = app.CreateWindow(); window.FlowDirection = FlowDirection.RightToLeft; Assert.IsTrue((window.Page as IFlowDirectionController) .EffectiveFlowDirection .IsRightToLeft()); window.Page = new ContentPage(); Assert.IsTrue((window.Page as IFlowDirectionController) .EffectiveFlowDirection .IsRightToLeft()); }
public void CreateAndRemoveOverlayWindow() { var app = new TestApp(); var window = app.CreateWindow() as IWindow; app.LoadPage(new ContentPage()); var windowOverlay = new WindowOverlay(window) as IWindowOverlay; // If not processed by a window, should be false. Assert.False(windowOverlay.IsNativeViewInitialized); // First time inserted, should be true. Assert.True(window.AddOverlay(windowOverlay)); // Should now be initialized. Assert.True(windowOverlay.IsNativeViewInitialized); Assert.True(window.Overlays.Count > 0); // Can't insert same window overlay again, should be false. Assert.False(window.AddOverlay(windowOverlay)); // Should remove from collection, should be true. Assert.True(window.RemoveOverlay(windowOverlay)); // Not in collection, should be false. Assert.False(window.RemoveOverlay(windowOverlay)); // Window was uninitialized, should be false. Assert.False(windowOverlay.IsNativeViewInitialized); // Second time inserted, should be true. Assert.True(window.AddOverlay(windowOverlay)); // Should now be initialized again. Assert.True(windowOverlay.IsNativeViewInitialized); }