Пример #1
0
        public void IFwTool_CloseDbAndWindows()
        {
            CheckDisposed();

            // Preparations
            string     serverName = MiscUtils.LocalServerName;
            DummyFwApp app        = m_app as DummyFwApp;

            app.SetFdoCache(serverName, "TestLangProj", Cache);

            using (InMemoryFdoCache mockedCache = InMemoryFdoCache.CreateInMemoryFdoCache())
            {
                app.SetFdoCache(serverName, "LelaTeli-2", mockedCache.Cache);

                int pidNew;
                m_app.NewMainWnd(serverName, "TestLangProj", 1, 0, 0, 0, 0, out pidNew);
                m_app.NewMainWnd(serverName, "TestLangProj", 1, 0, 0, 0, 0, out pidNew);
                m_app.NewMainWnd(serverName, "LelaTeli-2", 1, 0, 0, 0, 0, out pidNew);

                Assert.AreEqual(3, app.m_nMainWnd);
                app.m_mainWnd[0].Cache = Cache;
                app.m_mainWnd[1].Cache = Cache;
                app.m_mainWnd[2].Cache = mockedCache.Cache;

                // Here is what we want to test
                ((IFwTool)m_app).CloseDbAndWindows(serverName, "TestLangProj", true);

                Assert.IsTrue(app.m_mainWnd[0].m_fClosed);
                Assert.IsTrue(app.m_mainWnd[1].m_fClosed);
                Assert.IsFalse(app.m_mainWnd[2].m_fClosed);
            }
        }
Пример #2
0
        public void IFwTool_CloseMainWnd()
        {
            CheckDisposed();

            // Preparations
            string     serverName = MiscUtils.LocalServerName;
            DummyFwApp app        = m_app as DummyFwApp;

            app.SetFdoCache(serverName, "TestLangProj", Cache);

            int pidNew;
            int hTool = m_app.NewMainWnd(serverName, "TestLangProj",
                                         1, 0, 0, 0, 0, out pidNew);

            app.m_mainWnd[0].Cache = Cache;

            // Here is what we want to test
            m_app.CloseMainWnd(hTool);

            Assert.IsTrue(app.m_mainWnd[0].m_fClosed);
        }