Ejemplo n.º 1
0
        public void DisposeDisconnects()
        {
            var dbConn = ConnectionFactory.Create();
            int before = TestUtil.SelectCount(dbConn, Session.TABLE);

            using (var wfConn = new DataCapture.Workflow.Yeti.Connection())
            {
                Assert.IsNotNull(wfConn);
                Console.WriteLine(wfConn);
            }
            int after = TestUtil.SelectCount(dbConn, Session.TABLE);

            Assert.AreEqual(before, after);
        }
Ejemplo n.º 2
0
        public void CanConnect()
        {
            var dbConn = ConnectionFactory.Create();
            var user   = TestUtil.MakeUser(dbConn);
            var wfConn = new DataCapture.Workflow.Yeti.Connection();

            int before = TestUtil.SelectCount(dbConn, Session.TABLE);

            Assert.AreEqual(wfConn.IsConnected, false);
            Assert.GreaterOrEqual(before, 0);

            wfConn.Connect(user.Login);
            int afterConnect = TestUtil.SelectCount(dbConn, Session.TABLE);

            Assert.AreEqual(wfConn.IsConnected, true);
            Assert.AreEqual(before + 1, afterConnect);

            wfConn.Disconnect();
            int afterDisconnect = TestUtil.SelectCount(dbConn, Session.TABLE);

            Assert.AreEqual(wfConn.IsConnected, false);
            Assert.AreEqual(before, afterDisconnect);
        }