示例#1
0
        public void PivotPresenterLayoutXmlTest()
        {
            var     mocks   = new Mockery();
            DataSet dataSet = GetPivotDataSet();
            PivotDetailPresenter pivotDetailPresenter = GetAndCheckPivotPresenter(mocks, dataSet);

            Assert.AreEqual("xxx", pivotDetailPresenter.SettingsXml);
            pivotDetailPresenter.SettingsXml = "yyy";
            Assert.AreEqual("yyy", pivotDetailPresenter.SettingsXml);

            mocks.VerifyAllExpectationsHaveBeenMet();
        }
示例#2
0
        public void PivotPresenterNullDatasetTest()
        {
            try
            {
                var mocks = new Mockery();
                PivotDetailPresenter pivotDetailPresenter = GetAndCheckPivotPresenter(mocks, null);

                pivotDetailPresenter.SettingsXml = "yyy";

                mocks.VerifyAllExpectationsHaveBeenMet();
            }
            catch (AvrException ex)
            {
                Assert.AreEqual("Dataset of view pivotDetailView is not initialized", ex.Message);
            }
        }
示例#3
0
        private void InitPresentersAndViews()
        {
            using (PresenterFactory.BeginSharedPresenterTransaction(StructureMapContainerInit(), new BaseForm()))
            {
                var mocks = new Mockery();

                var chartView = DataHelper.GetView <IChartView>(mocks);

                m_ChartPresenter = DataHelper.GetPresenter <ChartPresenter>(chartView);
                Assert.IsNotNull(m_ChartPresenter);

                IPivotDetailView pivotView = PivotPresenterReportTests.GetPivotView(mocks);
                m_PivotDetailPresenter = DataHelper.GetPresenter <PivotDetailPresenter>(pivotView);
                Assert.IsNotNull(m_PivotDetailPresenter);

                var mapView = DataHelper.GetView <IMapView>(mocks);
                m_MapPresenter = DataHelper.GetPresenter <MapPresenter>(mapView);
                Assert.IsNotNull(m_MapPresenter);

                var layoutInfoView = DataHelper.GetView <IPivotInfoDetailView>(mocks);
                m_PivotInfoPresenter = DataHelper.GetPresenter <PivotInfoPresenter>(layoutInfoView);
                Assert.IsNotNull(m_PivotInfoPresenter);

                var viewDetailView = DataHelper.GetView <IViewDetailView>(mocks);
                m_ViewDetailPresenter = DataHelper.GetPresenter <ViewDetailPresenter>(viewDetailView);
                Assert.IsNotNull(m_ViewDetailPresenter);



                var layoutDetailView = DataHelper.GetView <ILayoutDetailView>(mocks);

                m_LayoutDetailPresenter = DataHelper.GetPresenter <LayoutDetailPresenter>(layoutDetailView);
                Assert.IsNotNull(m_LayoutDetailPresenter);

                var pivotGridView = mocks.NewMock <IAvrPivotGridView>();
                Expect.Once.On(pivotGridView).EventAdd("SendCommand", Is.Anything);
                m_PivotGridPresenter = PresenterFactory.SharedPresenter[pivotGridView] as AvrPivotGridPresenter;
                Assert.IsNotNull(m_PivotGridPresenter);


                mocks.VerifyAllExpectationsHaveBeenMet();
            }
        }