Represents a trace event that contains a message.
Inheritance: TraceEvent
Ejemplo n.º 1
0
		public void WhenMessageToStringInvoked_ThenContainsEventTypeAndMessage()
		{
			var traceEvent = new MessageTraceEvent(TraceEventType.Information, 0, "Foo", new object[0]);

			Assert.Contains(TraceEventType.Information.ToString(), traceEvent.ToString());
			Assert.Contains("Foo", traceEvent.ToString());
		}
Ejemplo n.º 2
0
		public void WhenTracing_ThenTracesEach()
		{
			var ev = new MessageTraceEvent(TraceEventType.Information, 0, "foo");

			this.aggregate.Trace(ev);

			this.first.Verify(x => x.Trace(ev));
			this.second.Verify(x => x.Trace(ev));
		}
Ejemplo n.º 3
0
		public void WhenMessageWithFormatToStringInvoked_ThenContainsEventTypeAndFormattedMessge()
		{
			var traceEvent = new MessageTraceEvent(TraceEventType.Information, 0, "Hello {0}", "World");

			Assert.Contains("Hello World", traceEvent.ToString());
		}
Ejemplo n.º 4
0
		public void WhenMessageEventHasEmptyFormatArgs_ThenNoFormattingIsPerformed()
		{
			var traceEvent = new MessageTraceEvent(TraceEventType.Information, 0, "Foo", new object[0]);

			Assert.Contains("Foo", traceEvent.MessageOrFormat);
		}