From fd571d8e8357afc34cf257ccf2ce9de0939de9b0 Mon Sep 17 00:00:00 2001 From: Michael Pendon Date: Sat, 5 Sep 2020 15:12:24 +0200 Subject: [PATCH] Added an integration tests for Type Result with more columns. #538 --- .../RepoDb.IntegrationTests/ExecuteQueryRawTest.cs | 12 ++++++++++++ 1 file changed, 12 insertions(+) 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