public void ConstructorHappyPath() { var transactionalSender = new Mock <ITransactionalSender>().Object; Action <SenderMessage> validate = message => { }; var validatingTransactionalSender = new ValidatingTransactionalSender("Foo", transactionalSender, validate); validatingTransactionalSender.Name.Should().Be("Foo"); validatingTransactionalSender.Sender.Should().BeSameAs(transactionalSender); validatingTransactionalSender.TransactionalSender.Should().BeSameAs(transactionalSender); validatingTransactionalSender.Validate.Should().BeSameAs(validate); }
public void BeginTransactionMethodHappyPath() { var senderTransaction = new Mock <ISenderTransaction>().Object; var mockTransactionalSender = new Mock <ITransactionalSender>(); mockTransactionalSender.Setup(m => m.BeginTransaction()).Returns(senderTransaction); Action <SenderMessage> validate = message => { }; var validatingTransactionalSender = new ValidatingTransactionalSender("Foo", mockTransactionalSender.Object, validate); var actualTransaction = validatingTransactionalSender.BeginTransaction(); var validatingSenderTransaction = actualTransaction.Should().BeOfType <ValidatingSenderTransaction>().Subject; validatingSenderTransaction.Transaction.Should().BeSameAs(senderTransaction); validatingSenderTransaction.Validate.Should().BeSameAs(validate); }