Esempio n. 1
0
 private static RenderTreeFrame[] GetRenderTree(IComponent component)
 {
     var renderer = new TestRenderer();
     renderer.AttachComponent(component);
     component.SetParameters(ParameterCollection.Empty);
     return renderer.LatestBatchReferenceFrames;
 }
Esempio n. 2
0
        protected private RenderTreeFrame[] GetRenderTree(TestRenderer renderer, IComponent component)
        {
            renderer.AttachComponent(component);
            var task = renderer.Dispatcher.InvokeAsync(() => component.SetParametersAsync(ParameterCollection.Empty));

            // we will have to change this method if we add a test that does actual async work.
            Assert.True(task.Status.HasFlag(TaskStatus.RanToCompletion) || task.Status.HasFlag(TaskStatus.Faulted));
            if (task.IsFaulted)
            {
                ExceptionDispatchInfo.Capture(task.Exception.InnerException).Throw();
            }
            return(renderer.LatestBatchReferenceFrames);
        }