Exemplo n.º 1
0
 public void GetExecutor_FileDoesNotExistAndNoAlternative_ThrowsFileNotFoundException()
 {
     var conn = new ConnectionFromFile(SqlVendor.SqlServer)
                    {
                        FilePath = @"C:\DoesNotExist.txt"
                    };
     conn.GetExecutor();
 }
Exemplo n.º 2
0
        public void GetExecutor_FileDoesNotExistAndNoAlternative_ThrowsFileNotFoundException()
        {
            var conn = new ConnectionFromFile(SqlVendor.SqlServer)
            {
                FilePath = @"C:\DoesNotExist.txt"
            };

            conn.GetExecutor();
        }
Exemplo n.º 3
0
        public void GetExecutor_FileExists_UsesConnectionFromFile()
        {
            string path = @"..\..\MyConnection.txt";
            var    conn = new ConnectionFromFile(SqlVendor.SqlServer)
            {
                FilePath = path
            };

            var executor = conn.GetExecutor();

            Assert.AreEqual("MyConnection", executor.ConnectionString);
        }
Exemplo n.º 4
0
        public void GetExecutor_FileDoesNotExistButAlternativeIsGiven_UsesAlternativeConnection()
        {
            string alternative = "TheAlternative";
            var    conn        = new ConnectionFromFile(SqlVendor.SqlServer)
            {
                FilePath = @"C:\DoesNotExist.txt",
                AlternativeConnection = alternative
            };
            var executor = conn.GetExecutor();

            Assert.AreEqual(alternative, executor.ConnectionString);
        }
Exemplo n.º 5
0
        public void GetExecutor_FileExists_UsesConnectionFromFile()
        {
            string path = @"..\..\MyConnection.txt";
            var conn = new ConnectionFromFile(SqlVendor.SqlServer)
            {
                FilePath = path
            };

            var executor = conn.GetExecutor();

            Assert.AreEqual("MyConnection", executor.ConnectionString);
        }
Exemplo n.º 6
0
        public void GetExecutor_FileDoesNotExistButAlternativeIsGiven_UsesAlternativeConnection()
        {
            string alternative = "TheAlternative";
            var conn = new ConnectionFromFile(SqlVendor.SqlServer)
            {
                FilePath = @"C:\DoesNotExist.txt",
                AlternativeConnection = alternative
            };
            var executor = conn.GetExecutor();

            Assert.AreEqual(alternative, executor.ConnectionString);
        }
Exemplo n.º 7
0
        public void GetExecutor_FileNameNotGivenAndNoALternative_ThrowsInvalidOperationException()
        {
            var conn = new ConnectionFromFile(SqlVendor.SqlServer);

            conn.GetExecutor();
        }
Exemplo n.º 8
0
 public void GetExecutor_FileNameNotGivenAndNoALternative_ThrowsInvalidOperationException()
 {
     var conn = new ConnectionFromFile(SqlVendor.SqlServer);
     conn.GetExecutor();
 }