Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
SVN: branches/1.2.x@2995
- Loading branch information
Sergey Koshcheyev
committed
Sep 21, 2007
1 parent
8ae337e
commit 1f9bc8d
Showing
6 changed files
with
93 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
#if NET_2_0 | ||
using NUnit.Framework; | ||
|
||
using System; | ||
|
||
namespace NHibernate.Test.NHSpecificTest.NH1119 | ||
{ | ||
[TestFixture] | ||
public class Fixture : BugTestCase | ||
{ | ||
public override string BugNumber | ||
{ | ||
get { return "NH1119"; } | ||
} | ||
|
||
[Test] | ||
public void SelectMinFromEmptyTable() | ||
{ | ||
using (ISession s = OpenSession()) | ||
{ | ||
try | ||
{ | ||
DateTime dt = s.CreateQuery("select max(tc.DateTimeProperty) from TestClass tc").UniqueResult<DateTime>(); | ||
string msg = "Calling UniqueResult<T> where T is a value type" | ||
+ " should throw InvalidCastException when the result" | ||
+ " is null"; | ||
Assert.Fail(msg); | ||
} | ||
catch (InvalidCastException) { } | ||
} | ||
} | ||
} | ||
} | ||
#endif |
13 changes: 13 additions & 0 deletions
13
src/NHibernate.Test/NHSpecificTest/NH1119/Mappings.hbm.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
<?xml version="1.0" encoding="utf-8" ?> | ||
<hibernate-mapping xmlns="urn:nhibernate-mapping-2.2" | ||
namespace="NHibernate.Test.NHSpecificTest.NH1119" | ||
assembly="NHibernate.Test"> | ||
|
||
<class name="TestClass" table="TestClassNH1119"> | ||
<id name="ID"> | ||
<generator class="native"/> | ||
</id> | ||
<property name="DateTimeProperty"/> | ||
</class> | ||
|
||
</hibernate-mapping> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
using System; | ||
|
||
namespace NHibernate.Test.NHSpecificTest.NH1119 | ||
{ | ||
public class TestClass | ||
{ | ||
private int _ID; | ||
public virtual int ID | ||
{ | ||
get { return _ID; } | ||
set { _ID = value; } | ||
} | ||
|
||
private DateTime _DateTimeProperty; | ||
public virtual DateTime DateTimeProperty | ||
{ | ||
get { return _DateTimeProperty; } | ||
set { _DateTimeProperty = value; } | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters