Ejemplo n.º 1
0
        public void Extensions_GetInitialCatalogName_Returns_Null_If_Not_Found()
        {
            // Arrange
            DbConnectionStringBuilder value = new DbConnectionStringBuilder();

            // Act
            string result = value.GetInitialCatalogName();

            // Assert
            Assert.IsNull(result, "GetInitialCatalogName() returned incorrect value.");
        }
Ejemplo n.º 2
0
        public void Extensions_SetInitialCatalogName_Returns_Correct_Initial_Catalog()
        {
            // Arrange
            string connectionString = Convert.ToString(this.TestContext.DataRow["connectionString"], CultureInfo.InvariantCulture);
            string initialCatalog = Convert.ToString(this.TestContext.DataRow["initialCatalog"], CultureInfo.InvariantCulture);

            // Arrange
            DbConnectionStringBuilder value = new DbConnectionStringBuilder()
            {
                ConnectionString = connectionString,
            };

            // Act
            value.SetInitialCatalogName(initialCatalog);

            // Assert
            string result = value.GetInitialCatalogName();
            Assert.AreEqual(initialCatalog, result, "SetInitialCatalogName() did not set the correct value.");
        }
Ejemplo n.º 3
0
        public void Extensions_GetInitialCatalogName_Returns_Correct_Initial_Catalog()
        {
            // Arrange
            string connectionString = Convert.ToString(this.TestContext.DataRow["connectionString"], CultureInfo.InvariantCulture);
            string expected = Convert.ToString(this.TestContext.DataRow["expected"], CultureInfo.InvariantCulture);

            // Arrange
            DbConnectionStringBuilder value = new DbConnectionStringBuilder()
            {
                ConnectionString = connectionString,
            };

            // Act
            string actual = value.GetInitialCatalogName();

            // Assert
            Assert.AreEqual(expected, actual, "GetInitialCatalogName() returned incorrect value.");
        }