Exemplo n.º 1
0
        public void StandardWriteDoesNotLog()
        {
            CsvLogger logger = new CsvLogger();

            logger.Write("Foo");
            logger.GetClipboardData().Data.Should().BeNull();
        }
Exemplo n.º 2
0
        public void TableLogs()
        {
            Table table = Table.Create(1, 1);

            table.AddRow("One", "Two");
            table.AddRow("Three", "Four");

            CsvLogger logger = new CsvLogger();

            logger.Write(table);
            Stream stream = logger.GetClipboardData().Data as Stream;

            stream.Position = 0;
            StreamReader reader = new StreamReader(stream);

            reader.ReadToEnd().Should().Be("\"One\",\"Two\"\r\n\"Three\",\"Four\"\r\n");
        }
Exemplo n.º 3
0
            public void Dispose()
            {
                if (_aggregatedLogger != null)
                {
                    List <ClipboardData> allData = new List <ClipboardData>
                    {
                        _richTextLogger.GetClipboardData(),
                                         _textLogger.GetClipboardData(),
                                         _csvLogger.GetClipboardData(),
                                         _spreadsheetLogger.GetClipboardData()
                    };

                    ClipboardHelper.SetClipboardData(allData.ToArray());
                    _richTextLogger = null;

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