Previous CloneSet | Next CloneSet | Back to Main Report |
Clone Mass | Clones in CloneSet | Parameter Count | Clone Similarity | Syntax Category [Sequence Length] |
---|---|---|---|---|
30 | 2 | 4 | 0.987 | class_member_declaration |
Clone Abstraction | Parameter Bindings |
Clone Instance (Click to see clone) | Line Count | Source Line | Source File |
---|---|---|---|
1 | 30 | 388 | src/NHibernate.Test/QueryTest/MultiCriteriaFixture.cs |
2 | 30 | 420 | src/NHibernate.Test/QueryTest/MultiCriteriaFixture.cs |
| ||||
[Test] public void CanNotRetrieveCriteriaResultWithUnknownKey() { CreateItems(); using (ISession session = OpenSession()) { IMultiCriteria multiCriteria = session.CreateMultiCriteria(); ICriteria firstCriteria = session.CreateCriteria( typeof(Item)). Add (Expression.Lt("id", 50)); multiCriteria.Add("firstCriteria", firstCriteria); try { IList firstResult = (IList)multiCriteria.GetResult("unknownKey"); Assert.Fail("This should've thrown an InvalidOperationException"); } catch (InvalidOperationException) { } catch (Exception) { Assert.Fail("This should've thrown an InvalidOperationException"); } } RemoveAllItems(); } |
| ||||
[Test] public void CanNotRetrieveDetachedCriteriaResultWithUnknownKey() { CreateItems(); using (ISession session = OpenSession()) { IMultiCriteria multiCriteria = session.CreateMultiCriteria(); DetachedCriteria firstCriteria = DetachedCriteria.For( typeof(Item)). Add (Expression.Lt("id", 50)); multiCriteria.Add("firstCriteria", firstCriteria); try { IList firstResult = (IList)multiCriteria.GetResult("unknownKey"); Assert.Fail("This should've thrown an InvalidOperationException"); } catch (InvalidOperationException) { } catch (Exception) { Assert.Fail("This should've thrown an InvalidOperationException"); } } RemoveAllItems(); } |
| |||
[Test] public void [[#variable5544fe60]]() { CreateItems(); using (ISession session = OpenSession()) { IMultiCriteria multiCriteria = session.CreateMultiCriteria(); [[#variable68479ca0]]firstCriteria = [[#variable68479bc0]]. [[#variable68479b80]]( typeof(Item)).Add(Expression.Lt("id", 50)); multiCriteria.Add("firstCriteria", firstCriteria); try { IList firstResult = (IList)multiCriteria.GetResult("unknownKey"); Assert.Fail("This should've thrown an InvalidOperationException"); } catch (InvalidOperationException) { } catch (Exception) { Assert.Fail("This should've thrown an InvalidOperationException"); } } RemoveAllItems(); } |
CloneAbstraction |
Parameter Index | Clone Instance | Parameter Name | Value |
---|---|---|---|
1 | 1 | [[#5544fe60]] | CanNotRetrieveCriteriaResultWithUnknownKey |
1 | 2 | [[#5544fe60]] | CanNotRetrieveDetachedCriteriaResultWithUnknownKey |
2 | 1 | [[#68479ca0]] | ICriteria |
2 | 2 | [[#68479ca0]] | DetachedCriteria |
3 | 1 | [[#68479bc0]] | session |
3 | 2 | [[#68479bc0]] | DetachedCriteria |
4 | 1 | [[#68479b80]] | CreateCriteria |
4 | 2 | [[#68479b80]] | For |