コード例 #1
0
 public void SetUp()
 {
     orderConfirmationEmailBuilder = new OrderConfirmationEmailBuilder();
 }
コード例 #2
0
        public void SetUp()
        {
            mailSenderFake = Substitute.For<MailSender>();

            // this is the version where we decide to keep the unit large
            // i.e. include collaborating classes rather than unit testing
            // them separately
            //orderConfirmer = new OrderConfirmer(mailSenderFake, new OrderConfirmationEmailBuilder());

            // alternative is to test them separately
            //
            orderConfirmationEmailBuilderFake = Substitute.For<OrderConfirmationEmailBuilder>();
            orderConfirmer = new OrderConfirmer(mailSenderFake, orderConfirmationEmailBuilderFake);
        }
コード例 #3
0
 public OrderConfirmer(MailSender mailSender, OrderConfirmationEmailBuilder orderConfirmationEmailBuilder)
 {
     this.mailSender = mailSender;
     this.orderConfirmationEmailBuilder = orderConfirmationEmailBuilder;
 }