public void OnOrdersGridCellMouseDoubleClick_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.OnOrdersGridCellMouseDoubleClick();
 }
 public void OnOrdersGridCellMouseDoubleClick_fetches_selected_order_from_business_layer_and_opens_order_edit_view_and_binds_UI()
 {
     //arrange
     var orderFactory = MockRepository.GenerateMock<IOrderFactory>();
     var dataBinder = MockRepository.GenerateMock<IOrderListDataBinder>();
     var viewFactory = MockRepository.GenerateMock<IViewFactory>();
     var view = MockRepository.GenerateMock<IOrderListView>();
     var selectedOrder = MockRepository.GenerateStub<IOrderInfo>();
     var order = MockRepository.GenerateStub<IOrder>();
     var editView = MockRepository.GenerateMock<IOrderEditView>();
     var target = new OrderListPresenter(orderFactory, dataBinder, viewFactory);
     target.View = view;
     view.Expect(x => x.SelectedOrder)
         .Return(selectedOrder);
     selectedOrder.Stub(x => x.Id)
         .Return(1);
     orderFactory.Expect(x => x.Fetch(1))
         .Return(order);
     viewFactory.Expect(x => x.CreateOrderEditView(order))
         .Return(editView);
     editView.Expect(x => x.Show());
     dataBinder.Expect(x => x.BindUI(target));
     //act
     target.OnOrdersGridCellMouseDoubleClick();
     //assert
     view.VerifyAllExpectations();
     orderFactory.VerifyAllExpectations();
     editView.VerifyAllExpectations();
     dataBinder.VerifyAllExpectations();
 }