public void SetUp() { // setup mock Order and populate with default return values. order = new DynamicMock(typeof(Order)); order.SetupResult("Amount", 1002.0); order.SetupResult("Urgent", false); order.SetupResult("Number", 123); order.SetupResult("User", "joe"); // create mock Notifier notifier = new DynamicMock(typeof(Notifier)); // create real OrderProcessor to be tested orderProcessor = new OrderProcessor(); // switch the OrderProcessor to use the mock Notifier orderProcessor.notifier = (Notifier)notifier.MockInstance; }