public void TestWithFilterOn() { var target = new CompositeTarget("MyName"); var testTarget = new TestTarget(); target.Targets.Add(testTarget); var filter = new TestPostFilter {CanLogResult = false}; target.AddFilter(filter); target.Enqueue(new LogEntry()); Assert.Empty(testTarget.Entries); }
public void TestWithTwoTargetsAndActiveFilter() { var target = new CompositeTarget("MyName"); target.Targets.Add(new TestTarget()); target.Targets.Add(new TestTarget()); var filter = new TestPostFilter {CanLogResult = false}; target.AddFilter(filter); target.Enqueue(new LogEntry()); Assert.Empty(((TestTarget) target.Targets.First()).Entries); Assert.Empty(((TestTarget) target.Targets.Last()).Entries); }
public void TestWithFilterOn() { var target = new CompositeTarget("MyName"); var testTarget = new TestTarget(); target.Targets.Add(testTarget); var filter = new TestPostFilter { CanLogResult = false }; target.AddFilter(filter); target.Enqueue(new LogEntry()); Assert.Empty(testTarget.Entries); }
public void TestWithTwoTargetsAndActiveFilter() { var target = new CompositeTarget("MyName"); target.Targets.Add(new TestTarget()); target.Targets.Add(new TestTarget()); var filter = new TestPostFilter { CanLogResult = false }; target.AddFilter(filter); target.Enqueue(new LogEntry()); Assert.Empty(((TestTarget)target.Targets.First()).Entries); Assert.Empty(((TestTarget)target.Targets.Last()).Entries); }