Previous CloneSet | Next CloneSet | Back to Main Report |
Clone Mass | Clones in CloneSet | Parameter Count | Clone Similarity | Syntax Category [Sequence Length] |
---|---|---|---|---|
25 | 2 | 4 | 0.978 | class_member_declaration |
Clone Abstraction | Parameter Bindings |
Clone Instance (Click to see clone) | Line Count | Source Line | Source File |
---|---|---|---|
1 | 25 | 330 | src/NHibernate.Test/QueryTest/MultiCriteriaFixture.cs |
2 | 25 | 359 | src/NHibernate.Test/QueryTest/MultiCriteriaFixture.cs |
| ||||
[Test] public void CanNotAddCriteriaWithKeyThatAlreadyExists() { using (ISession session = OpenSession()) { IMultiCriteria multiCriteria = session.CreateMultiCriteria(); ICriteria firstCriteria = session.CreateCriteria( typeof(Item)). Add (Expression.Lt("id", 50)); ICriteria secondCriteria = session.CreateCriteria( typeof(Item)); multiCriteria.Add("firstCriteria", firstCriteria); try { multiCriteria.Add("firstCriteria", secondCriteria); Assert.Fail("This should've thrown an InvalidOperationException"); } catch (InvalidOperationException) { } catch (Exception) { Assert.Fail("This should've thrown an InvalidOperationException"); } } } |
| ||||
[Test] public void CanNotAddDetachedCriteriaWithKeyThatAlreadyExists() { using (ISession session = OpenSession()) { IMultiCriteria multiCriteria = session.CreateMultiCriteria(); DetachedCriteria firstCriteria = DetachedCriteria.For( typeof(Item)). Add (Expression.Lt("id", 50)); DetachedCriteria secondCriteria = DetachedCriteria.For( typeof(Item)); multiCriteria.Add("firstCriteria", firstCriteria); try { multiCriteria.Add("firstCriteria", secondCriteria); Assert.Fail("This should've thrown an InvalidOperationException"); } catch (InvalidOperationException) { } catch (Exception) { Assert.Fail("This should've thrown an InvalidOperationException"); } } } |
| |||
[Test] public void [[#variable6d8ae020]]() { using (ISession session = OpenSession()) { IMultiCriteria multiCriteria = session.CreateMultiCriteria(); [[#variable584d9fa0]]firstCriteria = [[#variable584d9f20]]. [[#variable584d9e60]]( typeof(Item)).Add(Expression.Lt("id", 50)); [[#variable584d9fa0]]secondCriteria = [[#variable584d9f20]]. [[#variable584d9e60]]( typeof(Item)); multiCriteria.Add("firstCriteria", firstCriteria); try { multiCriteria.Add("firstCriteria", secondCriteria); Assert.Fail("This should've thrown an InvalidOperationException"); } catch (InvalidOperationException) { } catch (Exception) { Assert.Fail("This should've thrown an InvalidOperationException"); } } } |
CloneAbstraction |
Parameter Index | Clone Instance | Parameter Name | Value |
---|---|---|---|
1 | 1 | [[#6d8ae020]] | CanNotAddCriteriaWithKeyThatAlreadyExists |
1 | 2 | [[#6d8ae020]] | CanNotAddDetachedCriteriaWithKeyThatAlreadyExists |
2 | 1 | [[#584d9fa0]] | ICriteria |
2 | 2 | [[#584d9fa0]] | DetachedCriteria |
3 | 1 | [[#584d9f20]] | session |
3 | 2 | [[#584d9f20]] | DetachedCriteria |
4 | 1 | [[#584d9e60]] | CreateCriteria |
4 | 2 | [[#584d9e60]] | For |