Example #1
0
        public void CreateConnectionStrings()
        {
            var results = OdbcWidget.ListDataSourceNames();

            foreach (var dsn in results)
            {
                var result = OdbcWidget.CreateConnectionString(dsn, "Satch", "Guitar+1", "DataCompression=True");

                Assert.AreEqual(result,
                                string.Format("DSN={0};uid=Satch;pwd=Guitar+1;DataCompression=True", dsn));
            }

            foreach (var dsn in results)
            {
                var result = OdbcWidget.CreateConnectionString(dsn, "Satch", "Guitar+1");

                Assert.AreEqual(result,
                                string.Format("DSN={0};uid=Satch;pwd=Guitar+1;", dsn));
            }

            foreach (var dsn in results)
            {
                var result = OdbcWidget.CreateConnectionString(dsn);

                Assert.AreEqual(result,
                                string.Format("DSN={0};", dsn));
            }
        }
Example #2
0
        public void GetOdbcConnectionsLocalMachine()
        {
            var result = OdbcWidget.ListDataSourceNames(Registry.LocalMachine);

            Assert.IsTrue(result.ToArray().Length > 0);
        }
Example #3
0
        public void GetOdbcConnectionsAll()
        {
            var result = OdbcWidget.ListDataSourceNames();

            Assert.IsTrue(result.ToArray().Length > 6);
        }
Example #4
0
        public void GetOdbcConnectionsCurrentUser()
        {
            var result = OdbcWidget.ListDataSourceNames(Registry.CurrentUser);

            Assert.IsTrue(result.ToArray().Length > 5);
        }