コード例 #1
0
        public void TestCloningConnection()
        {
            //Arrange
            SqlConnectionManager con = new SqlConnectionManager(ConnectionStringParameter);

            //Act
            IConnectionManager clone = con.Clone();

            //Assert
            Assert.NotEqual(clone, con);
        }
コード例 #2
0
        public void TestCloningIfAllowedConnection()
        {
            //Arrange
            SqlConnectionManager con = new SqlConnectionManager(ConnectionStringParameter)
            {
                LeaveOpen = true
            };

            //Act
            IConnectionManager cloneIfAllowed = con.CloneIfAllowed();
            IConnectionManager clone          = con.Clone();

            //Assert
            Assert.Equal(cloneIfAllowed, con);
            Assert.NotEqual(clone, con);
        }