Skip to content

Commit

Permalink
Added unit test for NH-2463
Browse files Browse the repository at this point in the history
  • Loading branch information
Dmitry Naumov committed Sep 18, 2012
1 parent d4c29d7 commit bdba4ae
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions src/NHibernate.Test/Linq/SelectionTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -306,6 +306,19 @@ public void CanSelectWrappedType()
Assert.IsTrue(query.ToArray().Length > 0);
}

[Test]
public void CanDoProjectionWithCast()
{
// NH-2463
var lst1 = db.Users.Select(p => new { p1 = p.Name }).ToList();

Assert.AreEqual(3, lst1.Count());

var lst2 = db.Users.Select(p => new { p1 = (p as User).Name }).ToList();

Assert.AreEqual(3, lst2.Count());
}

public class Wrapper<T>
{
public T item;
Expand Down

0 comments on commit bdba4ae

Please sign in to comment.