<commit_before>using System;
using System.Collections.Generic;
using NHibernate.Dialect;
using NUnit.Framework;

namespace NHibernate.Test.NHSpecificTest.NH1742
{
	[TestFixture]
	public class Fixture : BugTestCase
	{
		private ISession session;
		private ITransaction transaction;
		private Device device;
		private DateTime date = new DateTime(2000, 1, 1);

		protected override void OnSetUp()
		{
			base.OnSetUp();

			session = OpenSession();
			transaction = session.BeginTransaction();

			device = new Device();
			session.Save(device);

			var ev = new Event {Date = date, SendedBy = device};
			session.Save(ev);

			var d = new Description {Event = ev, Value = "Test", LanguageID = "it"};
			session.Save(d);

			IFilter f = session.EnableFilter("LanguageFilter").SetParameter("LanguageID", "it");

			f.Validate();
		}

		protected override void OnTearDown()
		{
			transaction.Rollback();
			session.Close();

			base.OnTearDown();
		}

		protected override bool AppliesTo(Dialect.Dialect dialect)
		{
			return dialect as MsSql2000Dialect != null;
		}

		[Test]
		public void BugTest()
		{
			IQuery query =
				session.CreateQuery("SELECT e FROM Event e " + " inner join fetch e.descriptions d "
				                    + " WHERE (e.SendedBy in( :dev)) " + " AND (e.Date >= :from) " + " AND (e.Date <= :to)"
				                    + " ORDER BY d.Value");

			var devices = new List<Device> {device};

			query.SetParameterList("dev", devices).SetDateTime("from", date).SetDateTime("to", date.AddMonths(1));

			Assert.AreEqual(1, query.List<Event>().Count);
		}

		[Test]
		public void WorkingTest()
		{
			IQuery query =
				session.CreateQuery("SELECT e FROM Event e " + " inner join fetch e.descriptions d " + " WHERE (e.Date >= :from) "
				                    + " AND (e.Date <= :to)" + " AND (e.SendedBy in( :dev)) " + " ORDER BY d.Value");

			var devices = new List<Device> {device};

			query.SetParameterList("dev", devices).SetDateTime("from", date).SetDateTime("to", date.AddMonths(1));

			Assert.AreEqual(1, query.List<Event>().Count);
		}
	}
}<commit_msg>Test for NH-2213 (was fixed by fixing parameters stuff)<commit_after>using System;
using System.Collections.Generic;
using NHibernate.Dialect;
using NUnit.Framework;

namespace NHibernate.Test.NHSpecificTest.NH1742
{
	[TestFixture]
	public class Fixture : BugTestCase
	{
		private ISession session;
		private ITransaction transaction;
		private Device device;
		private DateTime date = new DateTime(2000, 1, 1);

		protected override void OnSetUp()
		{
			base.OnSetUp();

			session = OpenSession();
			transaction = session.BeginTransaction();

			device = new Device();
			session.Save(device);

			var ev = new Event {Date = date, SendedBy = device};
			session.Save(ev);

			var d = new Description {Event = ev, Value = "Test", LanguageID = "it"};
			session.Save(d);

			IFilter f = session.EnableFilter("LanguageFilter").SetParameter("LanguageID", "it");

			f.Validate();
		}

		protected override void OnTearDown()
		{
			transaction.Rollback();
			session.Close();

			base.OnTearDown();
		}

		protected override bool AppliesTo(Dialect.Dialect dialect)
		{
			return dialect as MsSql2000Dialect != null;
		}

		[Test]
		public void BugTest()
		{
			IQuery query =
				session.CreateQuery("SELECT e FROM Event e " + " inner join fetch e.descriptions d "
				                    + " WHERE (e.SendedBy in( :dev)) " + " AND (e.Date >= :from) " + " AND (e.Date <= :to)"
				                    + " ORDER BY d.Value");

			var devices = new List<Device> {device};

			query.SetParameterList("dev", devices).SetDateTime("from", date).SetDateTime("to", date.AddMonths(1));

			Assert.AreEqual(1, query.List<Event>().Count);
		}

		[Test]
		public void WorkingTest()
		{
			IQuery query =
				session.CreateQuery("SELECT e FROM Event e " + " inner join fetch e.descriptions d " + " WHERE (e.Date >= :from) "
				                    + " AND (e.Date <= :to)" + " AND (e.SendedBy in( :dev)) " + " ORDER BY d.Value");

			var devices = new List<Device> {device};

			query.SetParameterList("dev", devices).SetDateTime("from", date).SetDateTime("to", date.AddMonths(1));

			Assert.AreEqual(1, query.List<Event>().Count);
		}

		[Test]
		public void NH2213()
		{
			IQuery query = session.CreateQuery("SELECT e FROM Event e " +
			                                   " inner join fetch e.descriptions d " +
			                                   " WHERE (e.SendedBy in( :dev)) " +
			                                   " AND (e.Date >= :from) " +
			                                   " AND (e.Date <= :to)" +
			                                   " ORDER BY d.Value");
			var devices = new List<Device>();
			devices.Add(device);
			query.SetParameterList("dev", devices);
			query.SetDateTime("from", date);
			query.SetDateTime("to", date.AddMonths(1));

			Assert.AreEqual(1, query.List<Event>().Count);
		}
	}
}
{'fraction_non_alphanumeric': 0.13727810650887573, 'fraction_numerical': 0.009072978303747535, 'mean_word_length': 2.480439258750858, 'pattern_counts': {'":': 0, '<': 18, '<?xml version=': 0, '>': 18, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 5, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5446210', 'n_tokens_mistral': 1853, 'n_tokens_neox': 1532, 'n_words': 382}