Trace() public méthode

public Trace ( TraceEvent traceEvent ) : void
traceEvent TraceEvent
Résultat void
Exemple #1
0
        public void PropertiesAreProperlySet()
        {
            var traceWriter = new TestTraceWriter(TraceLevel.Verbose);

            var properties = new Dictionary <string, object>
            {
                { "prop1", "prop1" },
                { "prop2", "prop2" },
                { "prop3", "prop3" }
            };

            traceWriter.Trace("test", TraceLevel.Verbose, properties);

            Assert.Equal(1, traceWriter.Traces.Count);

            var trace = traceWriter.Traces.First();

            foreach (var property in properties)
            {
                Assert.True(trace.Properties.ContainsKey(property.Key));
                Assert.Equal(property.Value, trace.Properties[property.Key]);
            }
        }
        public void PropertiesAreProperlySet()
        {
            var traceWriter = new TestTraceWriter(TraceLevel.Verbose);

            var properties = new Dictionary<string, object>
            {
                { "prop1", "prop1" },
                { "prop2", "prop2" },
                { "prop3", "prop3" }
            };

            traceWriter.Trace("test", TraceLevel.Verbose, properties);

            Assert.Equal(1, traceWriter.Traces.Count);

            var trace = traceWriter.Traces.First();
            foreach (var property in properties)
            {
                Assert.True(trace.Properties.ContainsKey(property.Key));
                Assert.Equal(property.Value, trace.Properties[property.Key]);
            }
        }