CloneSet172


Previous CloneSetNext CloneSetBack to Main Report
Clone
Mass
Clones in
CloneSet
Parameter
Count
Clone
Similarity
Syntax Category
[Sequence Length]
21220.981class_member_declaration
Clone AbstractionParameter Bindings
Clone Instance
(Click to see clone)
Line CountSource Line
Source File
121118
src/NHibernate.Test/NHSpecificTest/NH1291AnonExample/NH1291AnonExampleFixture.cs
222159
src/NHibernate.Test/NHSpecificTest/NH1291AnonExample/NH1291AnonExampleFixture.cs
Clone Instance
1
Line Count
21
Source Line
118
Source File
src/NHibernate.Test/NHSpecificTest/NH1291AnonExample/NH1291AnonExampleFixture.cs

                [Test]
                public void CanQueryUsingSavedRelations()
                {
                        using (ISession s = OpenSession())
                        {
                                using (ITransaction tx = s.BeginTransaction())
                                {
                                        IList<Person> people = s.CreateCriteria( typeof(Person)).List<Person> ();
                                        Home h1 = new Home("Eugene", 97402);
                                        Home h2 = new Home("Klamath Falls", 97603);
                                        people[0].Home = h1;
                                        people[1].Home = h2;
                                        s.Save(h1);
                                        s.Save(h2);

                                        IList list = s.CreateCriteria( typeof(Person)).CreateCriteria("Home").
                                                 Add (Example.Create(h1)).List();

                                        Assert.AreEqual(1, list.Count);
                                        Assert.AreEqual("Joe", ((Person)list[0]).Name);
                                        tx.Commit();
                                }
                        }
                }



Clone Instance
2
Line Count
22
Source Line
159
Source File
src/NHibernate.Test/NHSpecificTest/NH1291AnonExample/NH1291AnonExampleFixture.cs

                [Test]
                public void CanQueryUsingAnonRelations()
                {
                        using (ISession s = OpenSession())
                        {
                                using (ITransaction tx = s.BeginTransaction())
                                {
                                        IList<Person> people = s.CreateCriteria( typeof(Person)).List<Person> ();
                                        Home h1 = new Home("Eugene", 97402);
                                        Home h2 = new Home("Klamath Falls", 97603);
                                        people[0].Home = h1;
                                        people[1].Home = h2;
                                        s.Save(h1);
                                        s.Save(h2);

                                        IList list = s.CreateCriteria( typeof(Person)).
                                             CreateCriteria("Home").Add(Example.Create(new HomeAnon(97402))).List();
                                        //c# 3.5: Example.Create( new { Zip = 97402 } )

                                        Assert.AreEqual(1, list.Count);
                                        Assert.AreEqual("Joe", ((Person)list[0]).Name);
                                        tx.Commit();
                                }
                        }
                }



Clone AbstractionParameter Count: 2Parameter Bindings

[Test]
public void [[#variable27af3ac0]]()
{
   using (ISession s = OpenSession())
   {
      using (ITransaction tx = s.BeginTransaction())
      {
         IList<Person> people = s.CreateCriteria( typeof(Person)).List<Person> ();
         Home h1 = new Home("Eugene", 97402);
         Home h2 = new Home("Klamath Falls", 97603);
         people[0].Home = h1;
         people[1].Home = h2;
         s.Save(h1);
         s.Save(h2);
         IList list = s.CreateCriteria( typeof(Person)).CreateCriteria("Home").Add(Example.Create( [[#variable27af3a40]])).List();
         //c# 3.5: Example.Create( new { Zip = 97402 } )
         Assert.AreEqual(1, list.Count);
         Assert.AreEqual("Joe", ((Person)list[0]).Name);
         tx.Commit();
      }
   }
}

 

CloneAbstraction
Parameter Bindings
Parameter
Index
Clone
Instance
Parameter
Name
Value
11[[#27af3ac0]]
CanQueryUsingSavedRelations 
12[[#27af3ac0]]
CanQueryUsingAnonRelations 
21[[#27af3a40]]
h1 
22[[#27af3a40]]
new HomeAnon(97402)