Ejemplo n.º 1
0
        public static HtmlDocument BuildDocument(IUrlRegistry urls, string title, params HtmlTag[] tags)
        {
            string css = GetDiagnosticCss();

            var realTitle = "FubuMVC: " + title;

            var document = new HtmlDocument();

            document.Title = realTitle;

            var mainDiv = new HtmlTag("div").AddClass("main");

            mainDiv.Add("h2").Text("FubuMVC Diagnostics").Append(buildVersionTag());
            var navBar = mainDiv.Add("div").AddClass("homelink");

            if (urls != null)
            {
                navBar.Append(new LinkTag("Home", urls.UrlFor <BehaviorGraphWriter>(w => w.Index(), null)));
            }
            navBar.Add("span").Text(" > " + title);
            document.Add(mainDiv);

            mainDiv.Append(tags);

            document.AddStyle(css);

            return(document);
        }
Ejemplo n.º 2
0
        public ResultsWriter(HtmlDocument document, ITestContext context)
        {
            _document = document;
            _context  = context;

            _document.AddStyle(HtmlClasses.CSS());
        }
Ejemplo n.º 3
0
        public PreviewWriter(HtmlDocument document, ITestContext context)
        {
            _document = document;
            _context  = context;

            _document.AddStyle(HtmlClasses.CSS());


            _document.Push("div").AddClass("main");
        }
Ejemplo n.º 4
0
        public HtmlDocument BuildReport(FixtureLibrary library)
        {
            var document = new HtmlDocument();

            document.Title = "Fixture / Grammar Report Writer";
            document.AddStyle(HtmlClasses.CSS());

            library.ActiveFixtures.Where(f => f.Errors.Any()).Each(f => writeFailedFixture(document, f));

            library.ActiveFixtures.Where(f => f.HasGrammarErrors()).Each(f =>
            {
                writeGrammarErrorsFromFixture(document, f);
            });

            return(document);
        }
Ejemplo n.º 5
0
        public void Start(string description, DateTime runningTime)
        {
            _document = new HtmlDocument();
            _document.AddStyle(HtmlClasses.CSS());
            _document.Add("h1").Text(description);

            _document.AddJavaScript(HtmlClasses.JQuery());
            _document.AddJavaScript(HtmlClasses.SummaryFilter());
            _document.Add("div").Text("Executed at {0}".ToFormat(runningTime)).AddClass(HtmlClasses.CAPTION);

            _document.Add("hr");

            // _document and _table are HtmlTag objects
            _table = _document.Add("table");
            _table.Add("thead/tr", x =>
            {
                x.Add("th").Text("Test");
                x.Add("th").Text("Lifecycle");
                x.Add("th").Text("Result");
            });

            _tbody = _table.Add("tbody");
        }
Ejemplo n.º 6
0
 /// <summary>
 /// Creates new MessageView instance.
 /// </summary>
 public MessageView()
 {
     Html = new HtmlDocument();
     Html.AddStyle(File.ReadAllText("Assets/style.css"));
     MessagesWebView.Text = Html.ToString();
 }
Ejemplo n.º 7
0
 public void add_styling()
 {
     document.AddStyle("some styling");
     document.ToString().ShouldContain("</title><style>some styling</style></head>");
 }