public void ConvertTestNoStackData() { var writer = new StreamWriter(new MemoryStream()); var converter = new MessageIdConverter(); var log = Substitute.For<ILog>(); converter.Format(writer, new LoggingEvent(new LoggingEventData())); writer.Flush(); var result = TestUtilities.GetStringFromStream(writer.BaseStream); Assert.AreEqual("-", result); }
public void TestThatStartThreadLogicalActivitySetsTheMessageId() { var testId = "LogicalThreadActivity"; var writer = new StreamWriter(new MemoryStream()); var converter = new MessageIdConverter(); var log = Substitute.For<ILog>(); using (log.StartMessage(testId)) { converter.Format(writer, new LoggingEvent(new LoggingEventData())); writer.Flush(); var result = TestUtilities.GetStringFromStream(writer.BaseStream); Assert.AreEqual(testId, result); } }