CloneSet390


Previous CloneSetNext CloneSetBack to Main Report
Clone
Mass
Clones in
CloneSet
Parameter
Count
Clone
Similarity
Syntax Category
[Sequence Length]
25240.978class_member_declaration
Clone AbstractionParameter Bindings
Clone Instance
(Click to see clone)
Line CountSource Line
Source File
125330
src/NHibernate.Test/QueryTest/MultiCriteriaFixture.cs
225359
src/NHibernate.Test/QueryTest/MultiCriteriaFixture.cs
Clone Instance
1
Line Count
25
Source Line
330
Source File
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");
                                }
                        }
                }



Clone Instance
2
Line Count
25
Source Line
359
Source File
src/NHibernate.Test/QueryTest/MultiCriteriaFixture.cs

                [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");
                                }
                        }
                }



Clone AbstractionParameter Count: 4Parameter Bindings

[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 Bindings
Parameter
Index
Clone
Instance
Parameter
Name
Value
11[[#6d8ae020]]
CanNotAddCriteriaWithKeyThatAlreadyExists 
12[[#6d8ae020]]
CanNotAddDetachedCriteriaWithKeyThatAlreadyExists 
21[[#584d9fa0]]
ICriteria 
22[[#584d9fa0]]
DetachedCriteria 
31[[#584d9f20]]
session 
32[[#584d9f20]]
DetachedCriteria 
41[[#584d9e60]]
CreateCriteria 
42[[#584d9e60]]
For