<commit_before>using System;
using System.Data;
using System.Text;

using NHibernate.Engine;
using NExpression = NHibernate.Expression;
using NHibernate.SqlCommand;
using NHibernate.Type;

using NHibernate.DomainModel;
using NUnit.Framework;

namespace NHibernate.Test.ExpressionTest
{
	/// <summary>
	/// Test the Junction class.
	/// </summary>
	/// <remarks>
	/// There are no need for the subclasses Conjunction and Disjunction to have their own 
	/// TestFixtures because all they do is override one property.
	/// </remarks>
	[TestFixture]
	public class JunctionFixture : BaseExpressionFixture
	{
		NExpression.Conjunction _conjunction;
		
		[SetUp]
		public override void SetUp() 
		{
			base.SetUp();
			_conjunction = NExpression.Expression.Conjunction();
			_conjunction.Add(NExpression.Expression.IsNull("Address"))
				.Add(NExpression.Expression.Between("Count", 5, 10));
		}

		[Test]
		public void SqlString()
		{
			SqlString sqlString = _conjunction.ToSqlString(factoryImpl, typeof(Simple), "simple_alias", BaseExpressionFixture.EmptyAliasClasses );
			
			string expectedSql = "(simple_alias.address IS NULL and simple_alias.count_ between :simple_alias.count__lo and :simple_alias.count__hi)";
			
			CompareSqlStrings(sqlString, expectedSql, 2);
	
		}

		[Test]
		public void GetTypedValues() 
		{
			TypedValue[] typedValues = _conjunction.GetTypedValues( factoryImpl, typeof(Simple), BaseExpressionFixture.EmptyAliasClasses );

			TypedValue[] expectedTV = new TypedValue[2];
			expectedTV[0] = new TypedValue(NHibernateUtil.Int32, 5);
			expectedTV[1] = new TypedValue(NHibernateUtil.Int32, 10);

			Assert.AreEqual(2, typedValues.Length);

			for(int i=0; i<typedValues.Length; i++) 
			{
				Assert.AreEqual(expectedTV[i].Type, typedValues[i].Type);
				Assert.AreEqual(expectedTV[i].Value, typedValues[i].Value);
			}
		}

		[Test]
		public void ToString()
		{
			Assert.AreEqual( "(Address is null and Count between 5 and 10)",
				_conjunction.ToString() );
		}
		
	}
}<commit_msg>Fixed a warning, renamed the test not to conflict with Object.ToString()<commit_after>using System;
using System.Data;
using System.Text;

using NHibernate.Engine;
using NExpression = NHibernate.Expression;
using NHibernate.SqlCommand;
using NHibernate.Type;

using NHibernate.DomainModel;
using NUnit.Framework;

namespace NHibernate.Test.ExpressionTest
{
	/// <summary>
	/// Test the Junction class.
	/// </summary>
	/// <remarks>
	/// There are no need for the subclasses Conjunction and Disjunction to have their own 
	/// TestFixtures because all they do is override one property.
	/// </remarks>
	[TestFixture]
	public class JunctionFixture : BaseExpressionFixture
	{
		NExpression.Conjunction _conjunction;
		
		[SetUp]
		public override void SetUp() 
		{
			base.SetUp();
			_conjunction = NExpression.Expression.Conjunction();
			_conjunction.Add(NExpression.Expression.IsNull("Address"))
				.Add(NExpression.Expression.Between("Count", 5, 10));
		}

		[Test]
		public void SqlString()
		{
			SqlString sqlString = _conjunction.ToSqlString(factoryImpl, typeof(Simple), "simple_alias", BaseExpressionFixture.EmptyAliasClasses );
			
			string expectedSql = "(simple_alias.address IS NULL and simple_alias.count_ between :simple_alias.count__lo and :simple_alias.count__hi)";
			
			CompareSqlStrings(sqlString, expectedSql, 2);
	
		}

		[Test]
		public void GetTypedValues() 
		{
			TypedValue[] typedValues = _conjunction.GetTypedValues( factoryImpl, typeof(Simple), BaseExpressionFixture.EmptyAliasClasses );

			TypedValue[] expectedTV = new TypedValue[2];
			expectedTV[0] = new TypedValue(NHibernateUtil.Int32, 5);
			expectedTV[1] = new TypedValue(NHibernateUtil.Int32, 10);

			Assert.AreEqual(2, typedValues.Length);

			for(int i=0; i<typedValues.Length; i++) 
			{
				Assert.AreEqual(expectedTV[i].Type, typedValues[i].Type);
				Assert.AreEqual(expectedTV[i].Value, typedValues[i].Value);
			}
		}

		[Test]
		public void ToStringTest()
		{
			Assert.AreEqual( "(Address is null and Count between 5 and 10)",
				_conjunction.ToString() );
		}
		
	}
}
{'fraction_non_alphanumeric': 0.11614800294045577, 'fraction_numerical': 0.009311443273707424, 'mean_word_length': 4.3569553805774275, 'pattern_counts': {'":': 0, '<': 13, '<?xml version=': 0, '>': 11, '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': '4665287', 'n_tokens_mistral': 1488, 'n_tokens_neox': 1262, 'n_words': 294}