public void then_open_connection_is_not_disposed()
        {
            var dbConnection = new DbConnectionSpy { State = ConnectionState.Open };

            dbConnection.SafeClose();

            Assert.IsFalse(dbConnection.DisposeCalled);
        }
        public void then_open_connection_is_disposed_when_requested()
        {
            var dbConnection = new DbConnectionSpy { State = ConnectionState.Open };

            dbConnection.SafeClose(true);

            Assert.IsTrue(dbConnection.DisposeCalled);
        }
        public void then_open_connection_is_closed()
        {
            var dbConnection = new DbConnectionSpy { State = ConnectionState.Open };

            dbConnection.SafeClose();

            Assert.IsTrue(dbConnection.CloseCalled);
        }
        public void then_already_closed_connection_is_not_closed()
        {
            var dbConnection = new DbConnectionSpy {State = ConnectionState.Closed};

            dbConnection.SafeClose();

            Assert.IsFalse(dbConnection.CloseCalled);
        }
Esempio n. 5
0
        public void then_already_closed_connection_is_not_disposed()
        {
            var dbConnection = new DbConnectionSpy {
                State = ConnectionState.Closed
            };

            dbConnection.SafeClose();

            Assert.IsFalse(dbConnection.DisposeCalled);
        }
Esempio n. 6
0
        public void then_already_closed_connection_is_disposed_when_requested()
        {
            var dbConnection = new DbConnectionSpy {
                State = ConnectionState.Closed
            };

            dbConnection.SafeClose(true);

            Assert.IsTrue(dbConnection.DisposeCalled);
        }
Esempio n. 7
0
        public void then_open_connection_is_closed()
        {
            var dbConnection = new DbConnectionSpy {
                State = ConnectionState.Open
            };

            dbConnection.SafeClose();

            Assert.IsTrue(dbConnection.CloseCalled);
        }