| Previous CloneSet | Next CloneSet | Back to Main Report |
| Clone Mass | Clones in CloneSet | Parameter Count | Clone Similarity | Syntax Category [Sequence Length] |
|---|---|---|---|---|
| 10 | 8 | 4 | 0.955 | class_member_declaration |
| Clone Abstraction | Parameter Bindings |
| Clone Instance (Click to see clone) | Line Count | Source Line | Source File |
|---|---|---|---|
| 1 | 10 | 15 | src/NHibernate.Test/ExpressionTest/Projection/ProjectionFixture.cs |
| 2 | 10 | 42 | src/NHibernate.Test/ExpressionTest/Projection/ProjectionFixture.cs |
| 3 | 10 | 54 | src/NHibernate.Test/ExpressionTest/Projection/ProjectionFixture.cs |
| 4 | 10 | 66 | src/NHibernate.Test/ExpressionTest/Projection/ProjectionFixture.cs |
| 5 | 10 | 78 | src/NHibernate.Test/ExpressionTest/Projection/ProjectionFixture.cs |
| 6 | 10 | 117 | src/NHibernate.Test/ExpressionTest/Projection/ProjectionFixture.cs |
| 7 | 10 | 129 | src/NHibernate.Test/ExpressionTest/Projection/ProjectionFixture.cs |
| 8 | 10 | 170 | src/NHibernate.Test/ExpressionTest/Projection/ProjectionFixture.cs |
| ||||
[Test]
public void RowCountTest()
{
ISession session = factory.OpenSession();
IProjection expression = Projections.RowCount();
CreateObjects( typeof(Simple), session);
SqlString sqlString = expression.ToSqlString(criteria, 0, criteriaQuery, new CollectionHelper.EmptyMapClass<string, IFilter> ());
string expectedSql = "count(*) as y0_";
CompareSqlStrings(sqlString, expectedSql, 0);
session.Close();
}
|
| ||||
[Test]
public void MaxTest()
{
ISession session = factory.OpenSession();
IProjection expression = Projections.Max("Pay");
CreateObjects( typeof(Simple), session);
SqlString sqlString = expression.ToSqlString(criteria, 0, criteriaQuery, new CollectionHelper.EmptyMapClass<string, IFilter> ());
string expectedSql = "max(sql_alias.Pay) as y0_";
CompareSqlStrings(sqlString, expectedSql, 0);
session.Close();
}
|
| ||||
[Test]
public void MinTest()
{
ISession session = factory.OpenSession();
IProjection expression = Projections.Min("Pay");
CreateObjects( typeof(Simple), session);
SqlString sqlString = expression.ToSqlString(criteria, 0, criteriaQuery, new CollectionHelper.EmptyMapClass<string, IFilter> ());
string expectedSql = "min(sql_alias.Pay) as y0_";
CompareSqlStrings(sqlString, expectedSql, 0);
session.Close();
}
|
| ||||
[Test]
public void CountTest()
{
ISession session = factory.OpenSession();
IProjection expression = Projections.Count("Pay");
CreateObjects( typeof(Simple), session);
SqlString sqlString = expression.ToSqlString(criteria, 0, criteriaQuery, new CollectionHelper.EmptyMapClass<string, IFilter> ());
string expectedSql = "count(sql_alias.Pay) as y0_";
CompareSqlStrings(sqlString, expectedSql, 0);
session.Close();
}
|
| ||||
[Test]
public void CountDistinctTest()
{
ISession session = factory.OpenSession();
IProjection expression = Projections.CountDistinct("Pay");
CreateObjects( typeof(Simple), session);
SqlString sqlString = expression.ToSqlString(criteria, 0, criteriaQuery, new CollectionHelper.EmptyMapClass<string, IFilter> ());
string expectedSql = "count(distinct sql_alias.Pay) as y0_";
CompareSqlStrings(sqlString, expectedSql, 0);
session.Close();
}
|
| ||||
[Test]
public void IdTest()
{
ISession session = factory.OpenSession();
IProjection expression = Projections.Id();
CreateObjects( typeof(Simple), session);
SqlString sqlString = expression.ToSqlString(criteria, 0, criteriaQuery, new CollectionHelper.EmptyMapClass<string, IFilter> ());
string expectedSql = "sql_alias.id_ as y0_";
CompareSqlStrings(sqlString, expectedSql, 0);
session.Close();
}
|
| ||||
[Test]
public void PropertyTest()
{
ISession session = factory.OpenSession();
IProjection expression = Projections.Property("Pay");
CreateObjects( typeof(Simple), session);
SqlString sqlString = expression.ToSqlString(criteria, 0, criteriaQuery, new CollectionHelper.EmptyMapClass<string, IFilter> ());
string expectedSql = "sql_alias.Pay as y0_";
CompareSqlStrings(sqlString, expectedSql, 0);
session.Close();
}
|
| ||||
[Test]
public void SumTest()
{
ISession session = factory.OpenSession();
IProjection expression = Projections.Sum("Pay");
CreateObjects( typeof(Simple), session);
SqlString sqlString = expression.ToSqlString(criteria, 0, criteriaQuery, new CollectionHelper.EmptyMapClass<string, IFilter> ());
string expectedSql = "sum(sql_alias.Pay) as y0_";
CompareSqlStrings(sqlString, expectedSql, 0);
session.Close();
}
|
| |||
[Test]
public void [[#variable6e5281a0]]()
{
ISession session = factory.OpenSession();
IProjection expression = Projections. [[#variable6e528120]]( [[#variable6e5280a0]]);
CreateObjects( typeof(Simple), session);
SqlString sqlString = expression.ToSqlString(criteria, 0, criteriaQuery, new CollectionHelper.EmptyMapClass<string, IFilter> ());
string expectedSql = [[#variable6e528040]];
CompareSqlStrings(sqlString, expectedSql, 0);
session.Close();
}
|
| CloneAbstraction |
| Parameter Index | Clone Instance | Parameter Name | Value |
|---|---|---|---|
| 1 | 1 | [[#6e5281a0]] | RowCountTest |
| 1 | 2 | [[#6e5281a0]] | IdTest |
| 1 | 3 | [[#6e5281a0]] | PropertyTest |
| 1 | 4 | [[#6e5281a0]] | SumTest |
| 1 | 5 | [[#6e5281a0]] | MaxTest |
| 1 | 6 | [[#6e5281a0]] | CountTest |
| 1 | 7 | [[#6e5281a0]] | CountDistinctTest |
| 1 | 8 | [[#6e5281a0]] | MinTest |
| 2 | 1 | [[#6e528120]] | RowCount |
| 2 | 2 | [[#6e528120]] | Id |
| 2 | 3 | [[#6e528120]] | Property |
| 2 | 4 | [[#6e528120]] | Sum |
| 2 | 5 | [[#6e528120]] | Max |
| 2 | 6 | [[#6e528120]] | Count |
| 2 | 7 | [[#6e528120]] | CountDistinct |
| 2 | 8 | [[#6e528120]] | Min |
| 3 | 1 | [[#6e5280a0]] | |
| 3 | 2 | [[#6e5280a0]] | |
| 3 | 3 | [[#6e5280a0]] | "Pay" |
| 3 | 4 | [[#6e5280a0]] | "Pay" |
| 3 | 5 | [[#6e5280a0]] | "Pay" |
| 3 | 6 | [[#6e5280a0]] | "Pay" |
| 3 | 7 | [[#6e5280a0]] | "Pay" |
| 3 | 8 | [[#6e5280a0]] | "Pay" |
| 4 | 1 | [[#6e528040]] | "count(*) as y0_" |
| 4 | 2 | [[#6e528040]] | "sql_alias.id_ as y0_" |
| 4 | 3 | [[#6e528040]] | "sql_alias.Pay as y0_" |
| 4 | 4 | [[#6e528040]] | "sum(sql_alias.Pay) as y0_" |
| 4 | 5 | [[#6e528040]] | "max(sql_alias.Pay) as y0_" |
| 4 | 6 | [[#6e528040]] | "count(sql_alias.Pay) as y0_" |
| 4 | 7 | [[#6e528040]] | "count(distinct sql_alias.Pay) as y0_" |
| 4 | 8 | [[#6e528040]] | "min(sql_alias.Pay) as y0_" |