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); }
public OrderConfirmer(MailSender mailSender, OrderConfirmationEmailBuilder orderConfirmationEmailBuilder) { this.mailSender = mailSender; this.orderConfirmationEmailBuilder = orderConfirmationEmailBuilder; }