Exemple #1
0
        public static string GetHtml(ITestRenderer renderer, int componentId)
        {
            var frames      = renderer.GetCurrentRenderTreeFrames(componentId);
            var context     = new HtmlRenderingContext(renderer);
            var newPosition = RenderFrames(context, frames, 0, frames.Count);

            Debug.Assert(newPosition == frames.Count, $"frames.Count = {frames.Count}. newPosition = {newPosition}");
            return(string.Join(string.Empty, context.Result));
        }
Exemple #2
0
        /// <summary>
        /// Creates an instance of the parser with a AngleSharp context
        /// with the <paramref name="testRenderer"/> registered.
        /// </summary>
        public HtmlParser(ITestRenderer testRenderer, HtmlComparer htmlComparer)
        {
            var config = Configuration.Default
                         .WithCss()
                         .With(testRenderer)
                         .With(htmlComparer)
                         .With(this);

            _context    = BrowsingContext.New(config);
            _htmlParser = _context.GetService <IHtmlParser>();
            _document   = _context.OpenNewAsync().Result;
        }
Exemple #3
0
 public static string GetHtml(ITestRenderer renderer, int componentId)
 {
     return((string)_mi.Invoke(null, new object[] { renderer, componentId }) !);
 }
            public MockNavigationManager(ITestRenderer renderer)
            {
                Initialize("http://test/", "http://test/init");

                this.renderer = renderer;
            }