Skip to content

Commit

Permalink
Test for #524 (believed to be a failing test; cannot validate or fix …
Browse files Browse the repository at this point in the history
…until I get the latest tooling installed)
  • Loading branch information
mgravell committed May 27, 2016
1 parent 2c531d2 commit c3beb60
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions Dapper.Tests/Tests.QueryMultiple.cs
Expand Up @@ -135,5 +135,21 @@ select @b
var retVal = p.Get<int>("RetVal");
retVal.IsEqualTo(3);
}

[Fact]
public void Issue524_QueryMultiple_Cast()
{ // aka: Read<int> should work even if the data is a <long>

// using regular API
connection.Query<int>("select cast(42 as bigint)").IsEqualTo(42);
connection.QuerySingle<int>("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<int>().Single().IsEqualTo(42);
reader.ReadSingle<int>().IsEqualTo(42);
}
}
}
}

0 comments on commit c3beb60

Please sign in to comment.