Example #1
0
            public void Dispose()
            {
                if (this.aggregatedLogger != null)
                {
                    List<ClipboardData> allData = new List<ClipboardData>();
                    allData.Add(this.richTextLogger.GetClipboardData());
                    allData.Add(this.textLogger.GetClipboardData());
                    allData.Add(this.csvLogger.GetClipboardData());
                    allData.Add(this.spreadsheetLogger.GetClipboardData());

                    Clipboard.AddToClipboard(allData.ToArray());
                    this.richTextLogger = null;

                    this.csvLogger.Dispose();
                    this.spreadsheetLogger.Dispose();
                }
            }
Example #2
0
        public void SimpleTableOutput()
        {
            // Simple check that we match our expected output for various justifications and headers
            Table table = Table.Create(
                new ColumnFormat(1, ContentVisibility.CompressWhitespace, Justification.Left),
                new ColumnFormat(2, ContentVisibility.CompressWhitespace, Justification.Centered),
                new ColumnFormat(2, ContentVisibility.CompressWhitespace, Justification.Right));

            table.HasHeader = true;

            table.AddRow("Foo", "Bar", "FooBar");
            table.AddRow("one", "two", "three");

            RichTextLogger logger = new RichTextLogger();
            logger.Write(table);
            string output = logger.ToString();
            output.Should().Be(TestData.RtfSimpleTableOutputExpected);
        }
Example #3
0
            public ConsoleTaskLoggers(ITask task, IArgumentProvider arguments)
            {
                if (arguments.GetOption<bool?>(StandardOptions.Clipboard) ?? task.GetOptionDefault<bool>(StandardOptions.Clipboard[0]))
                {
                    this.richTextLogger = new RichTextLogger();
                    this.csvLogger = new CsvLogger();
                    this.textLogger = new TextLogger();
                    this.spreadsheetLogger = new XmlSpreadsheetLogger();
                    this.aggregatedLogger = new AggregatedLogger(
                        ConsoleLogger.Instance,
                        this.richTextLogger,
                        this.spreadsheetLogger,
                        this.csvLogger,
                        this.textLogger);

                    this.RegisterLogger(LoggerType.Result, this.aggregatedLogger);
                }
                else
                {
                    this.RegisterLogger(LoggerType.Result, ConsoleLogger.Instance);
                }

                this.RegisterLogger(LoggerType.Status, ConsoleLogger.Instance);
            }
            public void Dispose()
            {
                if (_aggregatedLogger != null)
                {
                    List<ClipboardData> allData = new List<ClipboardData>();
                    allData.Add(_richTextLogger.GetClipboardData());
                    allData.Add(_textLogger.GetClipboardData());
                    allData.Add(_csvLogger.GetClipboardData());
                    allData.Add(_spreadsheetLogger.GetClipboardData());

                    Clipboard.AddToClipboard(allData.ToArray());
                    _richTextLogger = null;

                    _csvLogger.Dispose();
                    _spreadsheetLogger.Dispose();
                }
            }