Skip to content

Commit 1c500e1

Browse files
committed
EXPERIMENTAL NH1421/Fixture.cs: Avoid use of non-generic collection. But this requires a small change in the exception message too.
1 parent d25058f commit 1c500e1

File tree

1 file changed

+4
-1
lines changed
  • src/NHibernate.Test/NHSpecificTest/NH1421

1 file changed

+4
-1
lines changed

src/NHibernate.Test/NHSpecificTest/NH1421/Fixture.cs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
using System;
22
using System.Collections;
3+
using System.Collections.Generic;
34
using NUnit.Framework;
45
using SharpTestsEx;
56
using System.Collections.ObjectModel;
@@ -34,7 +35,9 @@ public void WhenParameterListIsEmptyCollectionUsingQueryThenTrowsArgumentExcepti
3435
using (var s = OpenSession())
3536
{
3637
var query = s.CreateQuery("from AnEntity a where a.id in (:myList)");
37-
query.Executing(x => x.SetParameterList("myList", new ArrayList())).Throws().And.Exception.Should().Be.InstanceOf<ArgumentException>();
38+
39+
var ex = Assert.Throws<QueryException>(() => query.SetParameterList("myList", new List<object>()));
40+
Assert.That(ex.Message, Is.EqualTo("An empty parameter-list generates wrong SQL; parameter name 'myList'"));
3841
}
3942
}
4043

0 commit comments

Comments
 (0)