starting fixing proxy equality issue (false == proxy.Equals(proxy))
This commit is contained in:
@@ -263,6 +263,24 @@ namespace Spring.Aop.Framework.DynamicProxy
|
||||
string Company { get; set; }
|
||||
}
|
||||
|
||||
public class TestCustomer : ITestCustomer
|
||||
{
|
||||
public long Id
|
||||
{
|
||||
get; set;
|
||||
}
|
||||
|
||||
public string Name
|
||||
{
|
||||
get; set;
|
||||
}
|
||||
|
||||
public string Company
|
||||
{
|
||||
get; set;
|
||||
}
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
[Test(Description = "http://jira.springframework.org/browse/SPRNET-1174")]
|
||||
@@ -290,6 +308,22 @@ namespace Spring.Aop.Framework.DynamicProxy
|
||||
mocks.VerifyAll();
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void Equality()
|
||||
{
|
||||
TestCustomer customer = new TestCustomer();
|
||||
|
||||
AdvisedSupport advised = new AdvisedSupport();
|
||||
advised.Target = customer;
|
||||
advised.Interfaces = new Type[] { typeof(ITestCustomer) };
|
||||
|
||||
ITestCustomer to = CreateProxy(advised) as ITestCustomer;
|
||||
Assert.IsNotNull(to);
|
||||
Assert.IsTrue( to.Equals(to), "identity must be equal" );
|
||||
Assert.AreEqual(to, to);
|
||||
Assert.AreEqual(to, ((IAdvised)to).TargetSource.GetTarget());
|
||||
}
|
||||
|
||||
[Test]
|
||||
[ExpectedException(typeof(NotSupportedException)
|
||||
, ExpectedMessage = "Target 'target' is null.")]
|
||||
|
||||
@@ -44,7 +44,7 @@
|
||||
<WarningLevel>3</WarningLevel>
|
||||
<DebugType>full</DebugType>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<UseVSHostingProcess>true</UseVSHostingProcess>
|
||||
<UseVSHostingProcess>false</UseVSHostingProcess>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
|
||||
<OutputPath>..\..\..\build\VS.Net.2008\Spring.Aop.Tests\Release\</OutputPath>
|
||||
|
||||
Reference in New Issue
Block a user