Beispiel #1
0
        public void SetUp()
        {
            modelMock = new DynamicMock(typeof(ILoadImageModel))
            {
                Strict = true
            };

            model = modelMock.MockInstance as ILoadImageModel;

            imageListChangedConstraint = new SavedTypeOf(typeof(EventDelegate));
            modelMock.Expect("SubscribeImageListChanged", imageListChangedConstraint);

            startConstraint = new SavedTypeOf(typeof(EventDelegate));
            modelMock.Expect("SubscribeStart", startConstraint);

            finishConstraint = new SavedTypeOf(typeof(EventDelegate));
            modelMock.Expect("SubscribeFinish", finishConstraint);

            viewMock = new DynamicMock(typeof(ILoadImageView))
            {
                Strict = true
            };
            view = viewMock.MockInstance as ILoadImageView;

            loadCommandConstraint = new SavedTypeOf(typeof(EventDelegate));
            viewMock.Expect("SubscribeLoadCommand", loadCommandConstraint);

            new LoadImagePresenter(model, view);
        }
Beispiel #2
0
        public LoadImagePresenter(ILoadImageModel model, ILoadImageView view)
        {
            m_view  = view;
            m_model = model;

            m_view.SubscribeLoadCommand(new EventDelegate(SetSelectedImageInModel));

            m_model.SubscribeImageListChanged(new EventDelegate(PutImageListIntoView));
            m_model.SubscribeStart(new EventDelegate(StartDialogInView));
            m_model.SubscribeFinish(new EventDelegate(CloseDialogInView));
        }