public void SetUp()
 {
     dataLayerMock       = MockRepository.StrictMock <IDataLayer>();
     settingsStub        = MockRepository.Stub <ISettings>();
     eventDispatcherMock = MockRepository.StrictMock <IEventDispatcher>();
     viewMock            = MockRepository.StrictMock <IOptionsPageView>();
     loggerFactoryMock   = MockRepository.DynamicMock <ILoggerFactory>();
     loggerFactoryMock.Stub(x => x.GetLogger(null)).IgnoreArguments().Return(MockRepository.Stub <ILogger>());
     controller = new OptionsPageController(loggerFactoryMock, dataLayerMock, settingsStub, eventDispatcherMock);
 }
Пример #2
0
        public OptionsPage()
        {
            var loggerFactory   = ServiceLocator.Instance.Get <ILoggerFactory>();
            var dataLayer       = ServiceLocator.Instance.Get <IDataLayer>();
            var settings        = ServiceLocator.Instance.Get <ISettings>();
            var eventDispatcher = ServiceLocator.Instance.Get <IEventDispatcher>();

            controller     = new OptionsPageController(loggerFactory, dataLayer, settings, eventDispatcher);
            optionsControl = new OptionsPageControl();
            controller.RegisterView(optionsControl);
            controller.PrepareView();
            controller.Prepare();
        }
Пример #3
0
        public OptionsDialog()
        {
            InitializeComponent();

            var loggerFactory   = ServiceLocator.Instance.Get <ILoggerFactory>();
            var dataLayer       = ServiceLocator.Instance.Get <IDataLayer>();
            var settings        = ServiceLocator.Instance.Get <ISettings>();
            var eventDispatcher = ServiceLocator.Instance.Get <IEventDispatcher>();

            controller = new OptionsPageController(loggerFactory, dataLayer, settings, eventDispatcher);
            controller.RegisterView(optionsPage);
            controller.PrepareView();
            controller.Prepare();

            controller.UpdateData();

            btnOk.Click += btnOk_Click;
        }