| Previous CloneSet | Next CloneSet | Back to Main Report |
| Clone Mass | Clones in CloneSet | Parameter Count | Clone Similarity | Syntax Category [Sequence Length] |
|---|---|---|---|---|
| 6 | 3 | 1 | 0.993 | statement_list[6] |
| Clone Abstraction | Parameter Bindings |
| Clone Instance (Click to see clone) | Line Count | Source Line | Source File |
|---|---|---|---|
| 1 | 12 | 45 | src/NHibernate.Test/NHSpecificTest/NH1789/ProxyEqualityProblemTest.cs |
| 2 | 12 | 77 | src/NHibernate.Test/NHSpecificTest/NH1789/ProxyEqualityProblemTest.cs |
| 3 | 6 | 105 | src/NHibernate.Test/NHSpecificTest/NH1789/ProxyEqualityProblemTest.cs |
| ||||
//We load a proxy version of Maurice
var mauriceProxy = session.Load < ICat > ((long) 2);
Assert.IsTrue(mauriceProxy is INHibernateProxy, "The proxy should be of type INHibernateProxy");
//From it's proxy, we get a non-proxied (concrete?) version
var mauriceNonProxy = DomainObject.UnProxy < ICat > (mauriceProxy);
Assert.IsTrue( !(mauriceNonProxy is INHibernateProxy), "The non-proxy shouldn't be of type INHibernateProxy");
//We check if the name and ID matches (as they should be because they are the same entity!)
Assert.AreEqual(mauriceProxy.Name, mauriceNonProxy.Name, "The two objects should have the same name");
Assert.AreEqual(mauriceProxy.ID, mauriceNonProxy.ID, "The two objects should have the same ID");
|
| ||||
//We load a proxy version of Maurice
var mauriceProxy = session.Load < Cat > ((long) 2);
Assert.IsTrue(mauriceProxy is INHibernateProxy, "The proxy should be of type INHibernateProxy");
//From it's proxy, we get a non-proxied (concrete?) version
var mauriceNonProxy = DomainObject.UnProxy < Cat > (mauriceProxy);
Assert.IsTrue( !(mauriceNonProxy is INHibernateProxy), "The non-proxy shouldn't be of type INHibernateProxy");
//We check if the name and ID matches (as they should be because they are the same entity!)
Assert.AreEqual(mauriceProxy.Name, mauriceNonProxy.Name, "The two objects should have the same name");
Assert.AreEqual(mauriceProxy.ID, mauriceNonProxy.ID, "The two objects should have the same ID");
|
| ||||
//As before, we load a proxy, a non-proxy of the same entity, and checks everything is correct:
var mauriceProxy = session.Load < ICat > ((long) 2);
Assert.IsTrue(mauriceProxy is INHibernateProxy, "The proxy should be of type INHibernateProxy");
var mauriceNonProxy = DomainObject.UnProxy < ICat > (mauriceProxy);
Assert.IsTrue( !(mauriceNonProxy is INHibernateProxy), "The non-proxy shouldn't be of type INHibernateProxy");
Assert.AreEqual(mauriceProxy.Name, mauriceNonProxy.Name, "The two objects should have the same name");
Assert.AreEqual(mauriceProxy.ID, mauriceNonProxy.ID, "The two objects should have the same ID");
|
| |||
//As before, we load a proxy, a non-proxy of the same entity, and checks everything is correct: //We load a proxy version of Maurice var mauriceProxy = session.Load < [[#variable5eb60c00]]> ((long)2); Assert.IsTrue(mauriceProxy is INHibernateProxy, "The proxy should be of type INHibernateProxy"); //From it's proxy, we get a non-proxied (concrete?) version var mauriceNonProxy = DomainObject.UnProxy < [[#variable5eb60c00]]> (mauriceProxy); Assert.IsTrue( !(mauriceNonProxy is INHibernateProxy), "The non-proxy shouldn't be of type INHibernateProxy"); //We check if the name and ID matches (as they should be because they are the same entity!) Assert.AreEqual(mauriceProxy.Name, mauriceNonProxy.Name, "The two objects should have the same name"); Assert.AreEqual(mauriceProxy.ID, mauriceNonProxy.ID, "The two objects should have the same ID"); |
| CloneAbstraction |
| Parameter Index | Clone Instance | Parameter Name | Value |
|---|---|---|---|
| 1 | 1 | [[#5eb60c00]] | ICat |
| 1 | 2 | [[#5eb60c00]] | Cat |
| 1 | 3 | [[#5eb60c00]] | ICat |