Previous CloneSet | Next CloneSet | Back to Main Report |
Clone Mass | Clones in CloneSet | Parameter Count | Clone Similarity | Syntax Category [Sequence Length] |
---|---|---|---|---|
15 | 2 | 3 | 0.984 | class_member_declaration |
Clone Abstraction | Parameter Bindings |
Clone Instance (Click to see clone) | Line Count | Source Line | Source File |
---|---|---|---|
1 | 15 | 62 | src/NHibernate.Test/QueryTest/PositionalParametersFixture.cs |
2 | 15 | 80 | src/NHibernate.Test/QueryTest/PositionalParametersFixture.cs |
| ||||
[Test] public void TestPositionOutOfBounds() { ISession s = OpenSession(); ITransaction t = s.BeginTransaction(); try { IQuery q = s.CreateQuery("from s in class Simple where s.Name=? and s.Count=?"); // Try to set the third positional parameter Assert.Throws<ArgumentException> (() => q.SetParameter(3, "Fred")); } finally { t.Rollback(); s.Close(); } } |
| ||||
[Test] public void TestNoPositionalParameters() { 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"); // Try to set the first property Assert.Throws<ArgumentException> (() => q.SetParameter(0, "Fred")); } finally { t.Rollback(); s.Close(); } } |
| |||
[Test] public void [[#variable6de518c0]]() { ISession s = OpenSession(); ITransaction t = s.BeginTransaction(); try { IQuery q = s.CreateQuery( [[#variable70bd9bc0]]); // Try to set the third positional parameter // Try to set the first property Assert.Throws<ArgumentException> (() => q.SetParameter( [[#variable70e403c0]], "Fred")); } finally { t.Rollback(); s.Close(); } } |
CloneAbstraction |
Parameter Index | Clone Instance | Parameter Name | Value |
---|---|---|---|
1 | 1 | [[#6de518c0]] | TestPositionOutOfBounds |
1 | 2 | [[#6de518c0]] | TestNoPositionalParameters |
2 | 1 | [[#70bd9bc0]] | "from s in class Simple where s.Name=? and s.Count=?" |
2 | 2 | [[#70bd9bc0]] | "from s in class Simple where s.Name=:Name and s.Count=:Count" |
3 | 1 | [[#70e403c0]] | 3 |
3 | 2 | [[#70e403c0]] | 0 |