Beispiel #1
0
        public void MyTestInitialize()
        {
            m_Container = StructureMapContainerInit();
            BaseReportTests.InitDBAndLogin();
            using (PresenterFactory.BeginSharedPresenterTransaction(m_Container, new BaseForm()))
            {
                m_LayoutDB = new WinLayout_DB(PresenterFactory.SharedPresenter.SharedModel);
            }
            lock (m_LayoutDB.Connection)
            {
                OpenConnection();
                using (var command = new SqlCommand(GetQueryIdSQL))
                {
                    command.Connection = (SqlConnection)m_LayoutDB.Connection;
                    m_TestQueryId      = (long)command.ExecuteScalar();
                }
                CloseConnection();
            }

            m_PivotDB = new BaseAvrDbService();
            m_LayoutDB.AddLinkedDbService(m_PivotDB, null, RelatedPostOrder.SkipPost);

            m_ChartDB = new BaseAvrDbService();
            m_LayoutDB.AddLinkedDbService(m_ChartDB, null, RelatedPostOrder.SkipPost);

            LookupManager.AddObject("Query", null, AvrQueryLookup.Accessor.Instance(null).GetType(), "_SelectListInternal");
            LookupManager.AddObject("LayoutFolder", null, AvrFolderLookup.Accessor.Instance(null).GetType(), "_SelectListInternal");
            LookupManager.AddObject("Layout", null, AvrLayoutLookup.Accessor.Instance(null).GetType(), "_SelectListInternal");

            m_PresenterTransaction = PresenterFactory.BeginSharedPresenterTransaction(m_Container, new BaseForm());
        }
Beispiel #2
0
        public void GetAvrDbServiceTest()
        {
            var     db      = new BaseAvrDbService();
            DataSet dataSet = db.GetDetail(-1);

            Assert.IsNotNull(dataSet);
            Assert.AreEqual(0, dataSet.Tables.Count);
        }
Beispiel #3
0
        public void PostAvrDbServiceTest()
        {
            var dbService = new BaseAvrDbService();

            Assert.IsTrue(dbService.Post(new DataSet()));
        }