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(); }
public UIContext() { renderContext = CommonMocks.RenderContext().Object; scene = new UserInterfaceSceneDriver( renderContext, CommonMocks.StyleConfigurator().Object, CommonMocks.FontProvider().Object); }
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); }
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(); }