Previous CloneSet | Next CloneSet | Back to Main Report |
Clone Mass | Clones in CloneSet | Parameter Count | Clone Similarity | Syntax Category [Sequence Length] |
---|---|---|---|---|
19 | 3 | 4 | 0.975 | class_member_declaration |
Clone Abstraction | Parameter Bindings |
Clone Instance (Click to see clone) | Line Count | Source Line | Source File |
---|---|---|---|
1 | 19 | 19 | src/NHibernate.Test/QueryTest/NamedParametersFixture.cs |
2 | 19 | 18 | src/NHibernate.Test/QueryTest/PositionalParametersFixture.cs |
3 | 19 | 40 | src/NHibernate.Test/QueryTest/PositionalParametersFixture.cs |
| ||||
[Test] public void TestMissingHQLParameters() { ISession s = OpenSession(); ITransaction t = s.BeginTransaction(); try { IQuery q = s.CreateQuery("from s in class Simple where s.Name=:Name and s.Count=:Count"); // Just set the Name property not the count q.SetAnsiString("Name", "Fred"); // Try to execute it Assert.Throws<QueryException> (() => q.List()); } finally { t.Rollback(); s.Close(); } } |
| ||||
[Test] public void TestMissingHQLParameters() { ISession s = OpenSession(); ITransaction t = s.BeginTransaction(); try { IQuery q = s.CreateQuery("from s in class Simple where s.Name=? and s.Count=?"); // Set the first property, but not the second q.SetParameter(0, "Fred"); // Try to execute it Assert.Throws<QueryException> (() => q.List()); } finally { t.Rollback(); s.Close(); } } |
| ||||
[Test] public void TestMissingHQLParameters2() { ISession s = OpenSession(); ITransaction t = s.BeginTransaction(); try { IQuery q = s.CreateQuery("from s in class Simple where s.Name=? and s.Count=?"); // Set the second property, but not the first - should give a nice not found at position xxx error q.SetParameter(1, "Fred"); // Try to execute it Assert.Throws<QueryException> (() => q.List()); } finally { t.Rollback(); s.Close(); } } |
| |||
[Test] public void [[#variable66319c60]]() { ISession s = OpenSession(); ITransaction t = s.BeginTransaction(); try { IQuery q = s.CreateQuery( [[#variable66318a60]]); // Set the first property, but not the second // Set the second property, but not the first - should give a nice not found at position xxx error // Just set the Name property not the count q. [[#variable66319c00]]( [[#variable66319bc0]], "Fred"); // Try to execute it Assert.Throws<QueryException> (() => q.List()); } finally { t.Rollback(); s.Close(); } } |
CloneAbstraction |
Parameter Index | Clone Instance | Parameter Name | Value |
---|---|---|---|
1 | 1 | [[#66319c60]] | TestMissingHQLParameters |
1 | 2 | [[#66319c60]] | TestMissingHQLParameters2 |
1 | 3 | [[#66319c60]] | TestMissingHQLParameters |
2 | 1 | [[#66318a60]] | "from s in class Simple where s.Name=? and s.Count=?" |
2 | 2 | [[#66318a60]] | "from s in class Simple where s.Name=? and s.Count=?" |
2 | 3 | [[#66318a60]] | "from s in class Simple where s.Name=:Name and s.Count=:Count" |
3 | 1 | [[#66319c00]] | SetParameter |
3 | 2 | [[#66319c00]] | SetParameter |
3 | 3 | [[#66319c00]] | SetAnsiString |
4 | 1 | [[#66319bc0]] | 0 |
4 | 2 | [[#66319bc0]] | 1 |
4 | 3 | [[#66319bc0]] | "Name" |