Ejemplo n.º 1
0
        public void add_dividers_and_jagged_columns()
        {
            var report = new TextReport();
            report.AddDivider('=');
            report.StartColumns(3);
            report.AddText("This is the header");
            report.AddDivider('=');

            report.AddColumnData("a1***", "b1", "c1");
            report.AddColumnData("a2", "b2***", "c2");
            report.AddColumnData("a3", "b3", "c3***");
            report.AddDivider('=');

            var writer = new StringWriter();

            report.Write(writer);

            Debug.WriteLine(writer.ToString());

            writer.ToString().ShouldEqualWithLineEndings(@"
            =========================
            This is the header
            =========================
            a1***     b1        c1
            a2        b2***     c2
            a3        b3        c3***
            =========================
            ");
        }
Ejemplo n.º 2
0
        private static TextReport displayTimings(IEnumerable <TimedStep> ordered)
        {
            var writer = new FubuCore.Util.TextWriting.TextReport();

            writer.StartColumns(new Column(ColumnJustification.left, 0, 3), new Column(ColumnJustification.right, 0, 3),
                                new Column(ColumnJustification.right, 0, 3), new Column(ColumnJustification.right, 0, 3));
            writer.AddColumnData("Description", "Start", "Finish", "Duration");
            writer.AddDivider('-');

            ordered.Each(
                x => { writer.AddColumnData(x.Text, x.Start.ToString(), x.Finished.ToString(), x.Duration().ToString()); });

            return(writer);
        }
Ejemplo n.º 3
0
        public void simple_dividers_and_text()
        {
            var report = new TextReport();
            report.AddDivider('=');
            report.AddText("the title of this");
            report.AddDivider('=');

            var writer = new StringWriter();

            report.Write(writer);

            writer.ToString().ShouldEqualWithLineEndings(@"
            =================
            the title of this
            =================
            ");
        }
Ejemplo n.º 4
0
        private static void writeAssemblies(StringWriter writer)
        {
            var report = new TextReport();
            report.StartColumns(3);
            report.AddDivider('-');
            report.AddText("Assemblies");
            report.AddDivider('-');

            AppDomain.CurrentDomain.GetAssemblies().Each(assem => {
                var assemblyName = assem.GetName();
                var file = findCodebase(assem);
                report.AddColumnData(assemblyName.Name, assemblyName.Version.ToString(), file);
            });

            report.AddDivider('-');
            report.Write(writer);

            writer.WriteLine();
        }
Ejemplo n.º 5
0
        private static void writeProperties(StringWriter writer)
        {
            var report = new TextReport();
            report.StartColumns(2);

            if (FubuMvcPackageFacility.Restarted.HasValue)
                report.AddColumnData("Restarted", FubuMvcPackageFacility.Restarted.ToString());
            report.AddColumnData("Application Path", FubuMvcPackageFacility.GetApplicationPath());

            report.Write(writer);

            writer.WriteLine();
        }
        private static void writeProperties(StringWriter writer, FubuRuntime runtime)
        {
            var report = new TextReport();
            report.StartColumns(2);

            if (runtime.Restarted.HasValue)
                report.AddColumnData("Restarted", runtime.Restarted.ToString());
            report.AddColumnData("Application Path", runtime.Files.RootPath);

            report.Write(writer);

            writer.WriteLine();
        }