Exemplo n.º 1
0
        public void CanHaveSqlAuthentication()
        {
            var args = new[] {"--server", "server", "--database", "database", "--username", "user", "--password", "pass"};

            var options = new ConnectionStringOptions();
            var passed = ParseArguments(args, options);

            Assert.IsTrue(passed, "failed to parse args");
            var builder = options.ConnectionStringBuilder();
            Assert.AreEqual(false, builder.IntegratedSecurity);
            Assert.AreEqual("user", builder.UserID);
            Assert.AreEqual("pass", builder.Password);
        }
Exemplo n.º 2
0
        public void CanHaveIntegratedSecurity()
        {
            var args = new[] {"--server", "server", "--database", "database", "--integrated"};

            var options = new ConnectionStringOptions();
            var passed = ParseArguments(args, options);

            Assert.IsTrue(passed, "failed to parse args");
            var builder = options.ConnectionStringBuilder();
            Assert.AreEqual("server", builder.DataSource);
            Assert.AreEqual("database", builder.InitialCatalog);
            Assert.AreEqual(true, builder.IntegratedSecurity);
        }
Exemplo n.º 3
0
        public void UseTrustServerCert()
        {
            var args = new[]
            {
                "--server", "server", "--database", "database", "--username", "user", "--password", "pass",
                "--trust-server-certificate"
            };

            var options = new ConnectionStringOptions();
            var passed = ParseArguments(args, options);

            Assert.IsTrue(passed, "failed to parse args");
            var builder = options.ConnectionStringBuilder();
            Assert.AreEqual(true, builder.TrustServerCertificate);
        }