public void ConstructorSadPath2() { ITransactionalSender transactionalSender = null; Action <SenderMessage> validate = message => { }; Action act = () => new ValidatingTransactionalSender("Foo", transactionalSender, validate); act.Should().ThrowExactly <ArgumentNullException>().WithMessage("*sender*"); }
/// <summary> /// Initializes a new instances of the <see cref="ValidatingTransactionalSender"/> class. /// </summary> /// <param name="name">The name of the validating sender.</param> /// <param name="transactionalSender"> /// The <see cref="ITransactionalSender"/> that actually sends messages and begins transactions. /// </param> /// <param name="validate"> /// A delegate that will be invoked before each message is sent or added to a transaction. The delegate /// should throw an exception if header values are invalid or if required headers are missing. The delegate /// may also add missing headers that can be calculated at runtime. /// </param> public ValidatingTransactionalSender(string name, ITransactionalSender transactionalSender, Action <SenderMessage> validate) : base(name, transactionalSender, validate) { TransactionalSender = transactionalSender; }