public void CanUpdateCustomer() {
            EditCustomerViewStub view = new EditCustomerViewStub();
            EditCustomerPresenter presenter =new EditCustomerPresenter(view); 

            presenter.InitViewWith(TestGlobals.TestCustomer.ID);
            presenter.Update();
        }
        public void CanInitView() {
            EditCustomerViewStub view = new EditCustomerViewStub();
            EditCustomerPresenter presenter = new EditCustomerPresenter(view);

            view.AttachPresenter(presenter);
            presenter.InitViewWith(TestGlobals.TestCustomer.ID);

            Assert.AreEqual(TestGlobals.TestCustomer.ID, view.Customer.ID);
            Assert.AreEqual(TestGlobals.TestCustomer.CompanyName, view.Customer.CompanyName);
            Assert.AreEqual(TestGlobals.TestCustomer.ContactName, view.Customer.ContactName);
        }
    private void InitEditCustomerView()
    {
        presenter = new EditCustomerPresenter(this);
        ctrlEditCustomerView.AttachPresenter(presenter);

        // Listen for events coming from the view
        ctrlEditCustomerView.UpdateCompleted += HandleUpdateCompleted;
        ctrlEditCustomerView.UpdateCancelled += HandleUpdateCancelled;

        if (!IsPostBack)
        {
            presenter.InitViewWith(CustomerId);
        }
    }
示例#4
0
 public void AttachPresenter(EditCustomerPresenter presenter)
 {
     this.presenter = presenter;
 }
 public void AttachPresenter(EditCustomerPresenter presenter)
 {
 }