public async Task on_condition_with_negation_must_call_next_interceptor_unless_predicate_returns_true() { var probe = new InterceptorProbe(); var onCondition = new JournalInterceptors.OnCondition(_ => false, probe, negate: true); await onCondition.InterceptAsync(null); probe.WasCalled.Should().BeTrue(); }
public async Task on_condition_must_accept_async_lambda() { var probe = new InterceptorProbe(); var onCondition = new JournalInterceptors.OnCondition(_ => Task.FromResult(true), probe); await onCondition.InterceptAsync(null); probe.WasCalled.Should().BeTrue(); }
public async Task on_condition_must_pass_the_same_message_to_predicate() { var probe = new InterceptorProbe(); var expectedMessage = new Persistent("test"); var onCondition = new JournalInterceptors.OnCondition(message => { message.Should().BeSameAs(expectedMessage); return(false); }, probe); await onCondition.InterceptAsync(expectedMessage); }