public void StandardWriteDoesNotLog() { CsvLogger logger = new CsvLogger(); logger.Write("Foo"); logger.GetClipboardData().Data.Should().BeNull(); }
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"); }
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(); } }