예제 #1
0
파일: SqlDbTests.cs 프로젝트: hogberg43/App
        public void CloseConnection_ClosesEmptySqlServerConnection()
        {
            // Arrange
            var database = new SqlDb(new SqlConnection());

            // Act
            database.CloseConnection();

            // Assert
            Assert.IsTrue(_testConn.State == ConnectionState.Closed);
        }
예제 #2
0
파일: SqlDbTests.cs 프로젝트: hogberg43/App
        public void CloseConnection_ClosesSqlServerConnectionThatIsAlreadyClosed()
        {
            // Arrange
            if (_testConn.State == ConnectionState.Closed) _testConn.Close();
            var database = new SqlDb(_testConn);

            // Act
            database.CloseConnection();

            // Assert
            Assert.IsTrue(_testConn.State == ConnectionState.Closed);
        }
예제 #3
0
파일: SqlDbTests.cs 프로젝트: hogberg43/App
        public void CloseConnection_ClosesAnOpenSqlServerConnection()
        {
            // Arrange
            _testConn.Open();
            var database = new SqlDb(_testConn);

            // Act
            database.CloseConnection();

            // Assert
            Assert.IsTrue(_testConn.State == ConnectionState.Closed);
        }