public void ControllerTest() { var model = MockRepository.GenerateMock<ITodoListModel>(); var controller = new ListController(model); controller.Add("bob"); model.AssertWasCalled(x => x.AddToList("bob")); }
static void Main() { Application.EnableVisualStyles(); Application.SetCompatibleTextRenderingDefault(false); var model = new TodoListModel(); var controller = new ListController(model); var listDisplay = new ListDisplayForm(); model.ModelChanged += listDisplay.ModelChanged; listDisplay.Show(); var listDisplay2 = new ListDisplayForm(); model.ModelChanged += listDisplay2.ModelChanged; listDisplay2.Show(); Application.Run(new AddToListForm(controller)); }