public async Task on_type_must_not_call_next_interceptor_when_message_does_not_correspond_to_described_rules() { var probe = new InterceptorProbe(); var onType = new JournalInterceptors.OnType(typeof(SubclassMessage), probe); var message = new Persistent(new SpecificMessage()); await onType.InterceptAsync(message); probe.WasCalled.Should().BeFalse(); }
public async Task on_type_must_call_next_interceptor_when_message_is_implements_awaited_interface_type() { var probe = new InterceptorProbe(); var onType = new JournalInterceptors.OnType(typeof(IMessageWithInterface), probe); var message = new Persistent(new MessageWithInterface()); await onType.InterceptAsync(message); probe.WasCalled.Should().BeTrue(); probe.Message.Should().BeSameAs(message); }
public async Task on_type_must_call_next_interceptor_when_message_is_subclass_of_awaited_type() { var probe = new InterceptorProbe(); var onType = new JournalInterceptors.OnType(typeof(SpecificMessage), probe); var message = new Persistent(new SubclassMessage()); await onType.InterceptAsync(message); probe.WasCalled.Should().BeTrue(); probe.Message.Should().BeSameAs(message); }