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

            conn.GetExecutor();
        }
        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);
        }
        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);
        }
        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);
        }
        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);
        }
        public void GetExecutor_FileNameNotGivenAndNoALternative_ThrowsInvalidOperationException()
        {
            var conn = new ConnectionFromFile(SqlVendor.SqlServer);

            conn.GetExecutor();
        }
 public void GetExecutor_FileNameNotGivenAndNoALternative_ThrowsInvalidOperationException()
 {
     var conn = new ConnectionFromFile(SqlVendor.SqlServer);
     conn.GetExecutor();
 }