Exemplo n.º 1
0
        public void ConnectionStringBuilder_Validate()
        {
            //arrage
            string expectedConnString = @"Data Source=localhost;Initial Catalog=Database1;Integrated Security=True";

            //act
            string actualConnString = DatabaseHelpers.ConnectionStringBuilder(
                serverName: "localhost",
                databaseName: "Database1",
                integratedSecurity: true
                );

            //assert
            Assert.AreEqual(expectedConnString, actualConnString);
        }
Exemplo n.º 2
0
        public void ConnectionStringBuilder_ValidateUserAndPass()
        {
            //arrange
            string expectedConnString = @"Data Source=localhost;Initial Catalog=Database1;Integrated Security=False;User ID=User1;Password=Pass123";


            //act
            string actualConnString = DatabaseHelpers.ConnectionStringBuilder(
                serverName: "localhost",
                databaseName: "Database1",
                integratedSecurity: false,
                userName: "******",
                password: "******"
                );

            //assert
            Assert.AreEqual(expectedConnString, actualConnString);
        }