<commit_before>using NUnit.Framework;

namespace NHibernate.Test.NHSpecificTest.NH1981
{
	[TestFixture]
	public class Fixture : BugTestCase
	{
		protected override void OnSetUp()
		{
			using (var s = OpenSession())
			using (var tx = s.BeginTransaction())
			{
				s.Save(new Article { Longitude = 90 });
				s.Save(new Article { Longitude = 90 });
				s.Save(new Article { Longitude = 120 });

				tx.Commit();
			}
		}

		protected override void OnTearDown()
		{
			using (var s = OpenSession())
			using (var tx = s.BeginTransaction())
			{
				s.Delete("from Article");
				
				tx.Commit();
			}
		}

		[Test]
		public void CanGroupWithParameter()
		{
			using (var s = OpenSession())
			using (s.BeginTransaction())
			{
				const string queryString =
					@"select (Longitude / :divisor)
					  from Article
					  group by (Longitude / :divisor)
					  order by 1";

				var quotients = s.CreateQuery(queryString)
					.SetDouble("divisor", 30)
					.List<double>();

				Assert.That(quotients.Count, Is.EqualTo(2));
				Assert.That(quotients[0], Is.EqualTo(3));
				Assert.That(quotients[1], Is.EqualTo(4));
			}
		}
	}<commit_msg>Ignore Firebird<commit_after>using NUnit.Framework;

namespace NHibernate.Test.NHSpecificTest.NH1981
{
	[TestFixture]
	public class Fixture : BugTestCase
	{
		protected override bool AppliesTo(Dialect.Dialect dialect)
		{
			// Firebird doesn't support this feature
			return !(dialect is Dialect.FirebirdDialect);
		}

		protected override void OnSetUp()
		{
			using (var s = OpenSession())
			using (var tx = s.BeginTransaction())
			{
				s.Save(new Article { Longitude = 90 });
				s.Save(new Article { Longitude = 90 });
				s.Save(new Article { Longitude = 120 });

				tx.Commit();
			}
		}

		protected override void OnTearDown()
		{
			using (var s = OpenSession())
			using (var tx = s.BeginTransaction())
			{
				s.Delete("from Article");

				tx.Commit();
			}
		}

		[Test]
		public void CanGroupWithParameter()
		{
			using (var s = OpenSession())
			using (s.BeginTransaction())
			{
				const string queryString =
					@"select (Longitude / :divisor)
					  from Article
					  group by (Longitude / :divisor)
					  order by 1";

				var quotients = s.CreateQuery(queryString)
					.SetDouble("divisor", 30)
					.List<double>();

				Assert.That(quotients.Count, Is.EqualTo(2));
				Assert.That(quotients[0], Is.EqualTo(3));
				Assert.That(quotients[1], Is.EqualTo(4));
			}
		}
	}
{'fraction_non_alphanumeric': 0.13548915268112977, 'fraction_numerical': 0.015554645927138764, 'mean_word_length': 2.9292604501607715, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1785895', 'n_tokens_mistral': 1054, 'n_tokens_neox': 808, 'n_words': 187}