コード例 #1
0
 public void OnViewLoad_throws_exception_with_null_View()
 {
     //arrange
     var orderFactory = MockRepository.GenerateStub<IOrderFactory>();
     var dataBinder = MockRepository.GenerateStub<IOrderListDataBinder>();
     var viewFactory = MockRepository.GenerateStub<IViewFactory>();
     var target = new OrderListPresenter(orderFactory, dataBinder, viewFactory);
     //act, assert
     target.OnViewLoad();
 }
コード例 #2
0
 public void OnViewLoad_binds_UI()
 {
     //arrange
     var view = MockRepository.GenerateStub<IOrderListView>();
     var orderFactory = MockRepository.GenerateStub<IOrderFactory>();
     var dataBinder = MockRepository.GenerateMock<IOrderListDataBinder>();
     var viewFactory = MockRepository.GenerateStub<IViewFactory>();
     var target = new OrderListPresenter(orderFactory, dataBinder, viewFactory);
     target.View = view;
     dataBinder.Expect(x => x.BindUI(target));
     //act
     target.OnViewLoad();
     //assert
     dataBinder.VerifyAllExpectations();
 }