using NUnit.Framework;

using System;
using System.Collections.Generic;

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) { }
			}
		}
	}
}

using System;
using NUnit.Framework;

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())
			{
				DateTime dt = s.CreateQuery("select max(tc.DateTimeProperty) from TestClass tc").UniqueResult<DateTime>();
				Assert.AreEqual(default(DateTime), dt);
			}
		}
	}
}

Check the use of default(T) instead exception.
Check the use of default(T) instead exception.

SVN: 488784591515bd4cdaa016be4ec9b172dc4e7caf@3062
