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);
            }
Exemple #2
0
 public void NoLogNullClipboardData()
 {
     TextLogger logger = new TextLogger();
     logger.GetClipboardData().Data.Should().BeNull();
 }
Exemple #3
0
 public void SimpleWriteClipboardData()
 {
     TextLogger logger = new TextLogger();
     logger.Write("Foo");
     logger.GetClipboardData().Data.Should().Be("Foo");
 }
Exemple #4
0
 public void SimpleUnderline()
 {
     TextLogger logger = new TextLogger();
     logger.Write(WriteStyle.Underline, "Foo");
     logger.ToString().Should().Be("Foo\r\n---");
 }
Exemple #5
0
 public void SimpleWrite()
 {
     TextLogger logger = new TextLogger();
     logger.Write("Foo");
     logger.ToString().Should().Be("Foo");
 }