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