forked from nhibernate/nhibernate-core
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathPropertyExpressionFixture.cs
37 lines (31 loc) · 965 Bytes
/
PropertyExpressionFixture.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
using System;
using NHibernate.DomainModel;
using NHibernate.Criterion;
using NHibernate.SqlCommand;
using NUnit.Framework;
namespace NHibernate.Test.ExpressionTest
{
/// <summary>
/// Test the PropertyExpression class.
/// </summary>
/// <remarks>
/// There are no need for the subclasses EqPropertyExpression,
/// LePropertyExpression, or LtPropertyExpression to have their own
/// TestFixtures because all they do is override one property.
/// </remarks>
[TestFixture]
public class PropertyExpressionFixture : BaseExpressionFixture
{
[Test]
public void SqlStringTest()
{
ISession session = factory.OpenSession();
ICriterion expression = Expression.EqProperty("Address", "Name");
CreateObjects(typeof(Simple), session);
SqlString sqlString = expression.ToSqlString(criteria, criteriaQuery);
string expectedSql = "sql_alias.address = sql_alias.Name";
CompareSqlStrings(sqlString, expectedSql);
session.Close();
}
}
}