diff --git a/Dapper.Tests/Tests.QueryMultiple.cs b/Dapper.Tests/Tests.QueryMultiple.cs index deef2eddc14e24c0937007618f8962af091fd825..537c315191350910998d7a3582b783bf476e3eb8 100644 --- a/Dapper.Tests/Tests.QueryMultiple.cs +++ b/Dapper.Tests/Tests.QueryMultiple.cs @@ -135,5 +135,21 @@ select @b var retVal = p.Get("RetVal"); retVal.IsEqualTo(3); } + + [Fact] + public void Issue524_QueryMultiple_Cast() + { // aka: Read should work even if the data is a + + // using regular API + connection.Query("select cast(42 as bigint)").IsEqualTo(42); + connection.QuerySingle("select cast(42 as bigint)").IsEqualTo(42); + + // using multi-reader API + using(var reader = connection.QueryMultiple("select cast(42 as bigint); select cast(42 as bigint)")) + { + reader.Read().Single().IsEqualTo(42); + reader.ReadSingle().IsEqualTo(42); + } + } } }