CloneSet66


Previous CloneSetNext CloneSetBack to Main Report
Clone
Mass
Clones in
CloneSet
Parameter
Count
Clone
Similarity
Syntax Category
[Sequence Length]
28340.994class_member_declaration
Clone AbstractionParameter Bindings
Clone Instance
(Click to see clone)
Line CountSource Line
Source File
12836
src/NHibernate.Test/NHSpecificTest/NH1159/Fixture.cs
22866
src/NHibernate.Test/NHSpecificTest/NH1159/Fixture.cs
32996
src/NHibernate.Test/NHSpecificTest/NH1159/Fixture.cs
Clone Instance
1
Line Count
28
Source Line
36
Source File
src/NHibernate.Test/NHSpecificTest/NH1159/Fixture.cs

                [Test]
                public void DoesNotFlushWithCriteriaWithCommit()
                {
                        using (ISession session = OpenSession(new HibernateInterceptor()))
                        using (ITransaction tran = session.BeginTransaction())
                        {
                                session.FlushMode = FlushMode.Commit;
                                Assert.That(HibernateInterceptor.CallCount, Is.EqualTo(0));
                                Contact contact = session.Get < Contact > ((Int64)1);
                                contact.PreferredName = "Updated preferred name";
                                session.Flush();
                                Assert.That(HibernateInterceptor.CallCount, Is.EqualTo(1));

                                contact.Forename = "Updated forename";

                                Assert.That(HibernateInterceptor.CallCount, Is.EqualTo(1));

                                ICriteria query = session.CreateCriteria( typeof(ContactTitle));
                                query.Add(Expression.Eq("Id", (Int64)1));
                                query.UniqueResult<ContactTitle> ();

                                Assert.That(HibernateInterceptor.CallCount, Is.EqualTo(1));

                                contact.Surname = "Updated surname";
                                session.Flush();
                                Assert.That(HibernateInterceptor.CallCount, Is.EqualTo(2));

                                session.SaveOrUpdateCopy(contact);
                        }
                }



Clone Instance
2
Line Count
28
Source Line
66
Source File
src/NHibernate.Test/NHSpecificTest/NH1159/Fixture.cs

                [Test]
                public void DoesNotFlushWithCriteriaWithNever()
                {
                        using (ISession session = OpenSession(new HibernateInterceptor()))
                        using (ITransaction tran = session.BeginTransaction())
                        {
                                session.FlushMode = FlushMode.Never;
                                Assert.That(HibernateInterceptor.CallCount, Is.EqualTo(0));
                                Contact contact = session.Get < Contact > ((Int64)1);
                                contact.PreferredName = "Updated preferred name";
                                session.Flush();
                                Assert.That(HibernateInterceptor.CallCount, Is.EqualTo(1));

                                contact.Forename = "Updated forename";

                                Assert.That(HibernateInterceptor.CallCount, Is.EqualTo(1));

                                ICriteria query = session.CreateCriteria( typeof(ContactTitle));
                                query.Add(Expression.Eq("Id", (Int64)1));
                                query.UniqueResult<ContactTitle> ();

                                Assert.That(HibernateInterceptor.CallCount, Is.EqualTo(1));

                                contact.Surname = "Updated surname";
                                session.Flush();
                                Assert.That(HibernateInterceptor.CallCount, Is.EqualTo(2));

                                session.SaveOrUpdateCopy(contact);
                        }
                }



Clone Instance
3
Line Count
29
Source Line
96
Source File
src/NHibernate.Test/NHSpecificTest/NH1159/Fixture.cs

                [Test]
                public void DoesNotFlushWithCriteriaWithAuto()
                {
                        using (ISession session = OpenSession(new HibernateInterceptor()))
                        using (ITransaction tran = session.BeginTransaction())
                        {
                                session.FlushMode = FlushMode.Auto;
                                Assert.That(HibernateInterceptor.CallCount, Is.EqualTo(0));

                                Contact contact = session.Get < Contact > ((Int64)1);
                                contact.PreferredName = "Updated preferred name";
                                session.Flush();
                                Assert.That(HibernateInterceptor.CallCount, Is.EqualTo(1));

                                contact.Forename = "Updated forename";

                                Assert.That(HibernateInterceptor.CallCount, Is.EqualTo(1));

                                ICriteria query = session.CreateCriteria( typeof(ContactTitle));
                                query.Add(Expression.Eq("Id", (Int64)1));
                                query.UniqueResult<ContactTitle> ();

                                Assert.That(HibernateInterceptor.CallCount, Is.EqualTo(2));

                                contact.Surname = "Updated surname";
                                session.Flush();
                                Assert.That(HibernateInterceptor.CallCount, Is.EqualTo(3));

                                session.SaveOrUpdateCopy(contact);
                        }
                }



Clone AbstractionParameter Count: 4Parameter Bindings

[Test]
public void [[#variable6c2fb520]]()
{
   using (ISession session = OpenSession(new HibernateInterceptor()))
      using (ITransaction tran = session.BeginTransaction())
      {
         session.FlushMode = FlushMode. [[#variable6c2fb4e0]];
         Assert.That(HibernateInterceptor.CallCount, Is.EqualTo(0));
         Contact contact = session.Get < Contact > ((Int64)1);
         contact.PreferredName = "Updated preferred name";
         session.Flush();
         Assert.That(HibernateInterceptor.CallCount, Is.EqualTo(1));
         contact.Forename = "Updated forename";
         Assert.That(HibernateInterceptor.CallCount, Is.EqualTo(1));
         ICriteria query = session.CreateCriteria( typeof(ContactTitle));
         query.Add(Expression.Eq("Id", (Int64)1));
         query.UniqueResult<ContactTitle> ();
         Assert.That(HibernateInterceptor.CallCount, Is.EqualTo( [[#variable4d7bf500]]));
         contact.Surname = "Updated surname";
         session.Flush();
         Assert.That(HibernateInterceptor.CallCount, Is.EqualTo( [[#variable4d7bf260]]));
         session.SaveOrUpdateCopy(contact);
      }
}

 

CloneAbstraction
Parameter Bindings
Parameter
Index
Clone
Instance
Parameter
Name
Value
11[[#6c2fb520]]
DoesNotFlushWithCriteriaWithCommit 
12[[#6c2fb520]]
DoesNotFlushWithCriteriaWithNever 
13[[#6c2fb520]]
DoesNotFlushWithCriteriaWithAuto 
21[[#6c2fb4e0]]
Commit 
22[[#6c2fb4e0]]
Never 
23[[#6c2fb4e0]]
Auto 
31[[#4d7bf500]]
1 
32[[#4d7bf500]]
1 
33[[#4d7bf500]]
2 
41[[#4d7bf260]]
2 
42[[#4d7bf260]]
2 
43[[#4d7bf260]]
3