Permalink
Browse files

Added test for insert updating object's key

  • Loading branch information...
1 parent b991bf3 commit eed8b6f520d23988828af2f0c02fe34c33aa5c50 @greygeek committed Mar 11, 2012
Showing with 11 additions and 0 deletions.
  1. +11 −0 Dapper.Contrib.Tests/Tests.cs
@@ -104,6 +104,17 @@ public void InsertGetUpdate()
}
}
+ public void InsertCheckKey()
+ {
+ using (var connection = GetOpenConnection())
+ {
+ connection.Get<IUser>(3).IsNull();
+ User user = new User { Name = "Adamb", Age = 10 };
+ int id = (int)connection.Insert(user);
+ user.Id.IsEqualTo(id);
+ }
+ }
+
public void BuilderSelectClause()
{
using (var connection = GetOpenConnection())

0 comments on commit eed8b6f

Please sign in to comment.