diff --git a/RepoDb.Core/RepoDb.Tests/RepoDb.IntegrationTests/ExecuteQueryRawTest.cs b/RepoDb.Core/RepoDb.Tests/RepoDb.IntegrationTests/ExecuteQueryRawTest.cs index a59408841..69665d7ca 100644 --- a/RepoDb.Core/RepoDb.Tests/RepoDb.IntegrationTests/ExecuteQueryRawTest.cs +++ b/RepoDb.Core/RepoDb.Tests/RepoDb.IntegrationTests/ExecuteQueryRawTest.cs @@ -399,6 +399,18 @@ public void TestSqlConnectionExecuteQueryTypeResultForNullableDateTimeWithNullRe #endregion + + [TestMethod, ExpectedException(typeof(InvalidOperationException))] + public void ThrowExceptionOnSqlConnectionExecuteQueryTypeResultWithMoreColumns() + { + using (var connection = new SqlConnection(Database.ConnectionStringForRepoDb)) + { + // Act + connection.ExecuteQuery("SELECT 1 AS Column1, 2 AS Column2 UNION ALL SELECT 3, 4;").AsList(); + } + } + + #endregion #region NonMapped