System.Diagnostics.TraceSourceTests.TestTraceListener.GetCallCount C# (CSharp) Method

GetCallCount() public method

Gets the number of times any of the public methods on this instance were called.
public GetCallCount ( Method group ) : int
group Method
return int
        public int GetCallCount(Method group)
        {
            return _calls[(int)group];
        }

Usage Example

Beispiel #1
0
        public void WriteIf1Test()
        {
            var listener = new TestTraceListener();

            Trace.Listeners.Add(listener);
            Trace.WriteIf(false, (Object)"Message");
            Assert.Equal(0, listener.GetCallCount(Method.Write));
            Trace.WriteIf(true, (Object)"Message");
            Assert.Equal(1, listener.GetCallCount(Method.Write));
        }
All Usage Examples Of System.Diagnostics.TraceSourceTests.TestTraceListener::GetCallCount