示例#1
0
        protected void GivenEventThatDoesNotMatchSpecification()
        {
            GivenSomeEvent();
            var mockSpec = new Mock <IDiagnosticEventSpecification>();

            mockSpec.Setup(x => x.IsSatisfiedBy(Event)).Returns(false);
            Specification = mockSpec.Object;
        }
示例#2
0
 /// <summary>
 /// Initializes a new <see cref="FilteringSink"/> that wraps the specified
 /// <paramref name="inner"/> sink and only forwards events that match the supplied
 /// <paramref name="specification"/>
 /// </summary>
 /// <param name="inner">The event sink to wrap</param>
 /// <param name="specification">The specification that identifies the events that should
 /// be forwarded to the wrapped sink</param>
 public FilteringSink(IDiagnosticEventSink inner, IDiagnosticEventSpecification specification)
 {
     Inner          = inner ?? throw new ArgumentNullException(nameof(inner));
     _specification = specification ?? throw new ArgumentNullException(nameof(specification));
 }