Example #1
0
        public static void WaitForAnimations(this Desktop desktop)
        {
            var renderContext = CommonMocks.RenderContext();

            renderContext.Setup(x => x.GameTime).Returns(new GameTime(TimeSpan.FromSeconds(2), TimeSpan.FromSeconds(2)));

            desktop.Update(renderContext.Object);
            desktop.Update(renderContext.Object);
        }
        public FixedGridLayoutTests()
        {
            layout = new FixedGridLayout(16, 8);

            gridParentMetrics = new SizeMetrics();
            gridParentMetrics.ParentMaxSize = new Size(1920, 1080);

            renderContext = CommonMocks.RenderContext();
        }
Example #3
0
        public UIContext()
        {
            renderContext = CommonMocks.RenderContext().Object;

            scene = new UserInterfaceSceneDriver(
                renderContext,
                CommonMocks.StyleConfigurator().Object,
                CommonMocks.FontProvider().Object);
        }
Example #4
0
        public LabelTest()
        {
            fontCore = new FakeFontCore("default");
            font     = new Font(fontCore);

            fontProvider = new FontProvider();
            fontProvider.Add("default", font);

            contentLayout = new ContentLayoutEngine(fontProvider);

            context = CommonMocks.RenderContext(contentLayout);
        }
        public LabelWithLocalizationTest()
        {
            fontCore = new FakeFontCore("default");
            font     = new Font(fontCore);

            fontProvider = new FontProvider();
            fontProvider.Add("default", font);

            textRepo = new TextRepository();

            contentLayout = new LocalizedContentLayoutEngine(
                new ContentLayoutEngine(fontProvider), textRepo);

            context = CommonMocks.RenderContext(contentLayout);
        }
Example #6
0
        public TestUIDriver(IRenderable app,
                            IStyleConfigurator styleConfigurator     = null,
                            IFontProvider fontProvider               = null,
                            IContentLayoutEngine contentLayoutEngine = null)
        {
            var renderContext = CommonMocks.RenderContext(contentLayoutEngine).Object;

            uiDriver = new UserInterfaceSceneDriver(
                renderContext,
                styleConfigurator ?? new ThemeStyler(new ThemeCollection {
                ["default"] = Theme.CreateDefaultTheme()
            }),
                fontProvider ?? CommonMocks.FontProvider().Object);

            defaultWorkspace = new Workspace("default", app);

            input = new ManualInputState();

            uiDriver.Desktop.PushWorkspace(defaultWorkspace);

            DoLayout();
        }