public void WriteObjectTest() { var listener = new TestTraceListener(); listener.Filter = new TestTraceFilter(false); listener.Write((Object)"Message"); Assert.Equal(0, listener.GetCallCount(Method.Write)); listener.Filter = new TestTraceFilter(true); listener.Write((Object)null); Assert.Equal(0, listener.GetCallCount(Method.Write)); listener.Write((Object)"Message"); Assert.Equal(1, listener.GetCallCount(Method.Write)); }
public void WriteObjectTest() { var listener = new TestTraceListener(); listener.Filter = new TestTraceFilter(false); listener.Write((Object)"Message"); Assert.Equal(0, listener.GetCallCount(Method.Write)); listener.Filter = new TestTraceFilter(true); listener.Write((Object)null); Assert.Equal(0, listener.GetCallCount(Method.Write)); listener.Write((Object)"Message"); Assert.Equal(1, listener.GetCallCount(Method.Write)); }
public void WriteCategoryTest() { var listener = new TestTraceListener(); listener.Filter = new TestTraceFilter(false); listener.Write("Message", "Category"); Assert.Equal(0, listener.GetCallCount(Method.Write)); listener.Filter = new TestTraceFilter(true); listener.Write("Message", null); Assert.Equal(1, listener.GetCallCount(Method.Write)); listener.Write("Message", "Category"); Assert.Equal(2, listener.GetCallCount(Method.Write)); listener.Write(null, "Category"); Assert.Equal(3, listener.GetCallCount(Method.Write)); }
public void WriteCategoryTest() { var listener = new TestTraceListener(); listener.Filter = new TestTraceFilter(false); listener.Write("Message", "Category"); Assert.Equal(0, listener.GetCallCount(Method.Write)); listener.Filter = new TestTraceFilter(true); listener.Write("Message", null); Assert.Equal(1, listener.GetCallCount(Method.Write)); listener.Write("Message", "Category"); Assert.Equal(2, listener.GetCallCount(Method.Write)); listener.Write(null, "Category"); Assert.Equal(3, listener.GetCallCount(Method.Write)); }