User: cneuwirt
Date: 2009/11/12 01:21 PM
Added:
/DynamicProxy/trunk/src/Castle.DynamicProxy.Tests/GenClasses/
GenClassWithExplicitImpl.cs
Modified:
/DynamicProxy/trunk/src/Castle.DynamicProxy.Tests/
Castle.DynamicProxy.Tests-vs2008.csproj,
InvocationMethodInvocationTargetTestCase.cs
Log:
Added test case to demo MethodInvocationtarget issue
File Changes:
Directory: /DynamicProxy/trunk/src/Castle.DynamicProxy.Tests/
=============================================================
File [modified]: Castle.DynamicProxy.Tests-vs2008.csproj
Delta lines: +53 -0
===================================================================
---
DynamicProxy/trunk/src/Castle.DynamicProxy.Tests/GenClasses/GenClassWithExplicitImpl.cs
(rev 0)
+++
DynamicProxy/trunk/src/Castle.DynamicProxy.Tests/GenClasses/GenClassWithExplicitImpl.cs
2009-11-12 20:21:18 UTC (rev 6316)
@@ -0,0 +1,53 @@
+// Copyright 2004-2009 Castle Project - http://www.castleproject.org/
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+namespace Castle.DynamicProxy.Tests.GenClasses
+{
+ using System;
+ using System.ComponentModel;
+
+ public class GenClassWithExplicitImpl : IChangeTracking
+ {
+ bool IChangeTracking.IsChanged
+ {
+ get { return IsChanged; }
+ }
+
+ protected virtual bool IsChanged
+ {
+ get { return false; }
+ }
+
+ void IChangeTracking.AcceptChanges()
+ {
+ }
+
+ protected virtual void AcceptChanges()
+ {
+ }
+ }
+
+ public class GenClassWithExplicitImpl<T> : GenClassWithExplicitImpl
+ where T : IComparable
+ {
+ protected override bool IsChanged
+ {
+ get { return true; }
+ }
+
+ protected override void AcceptChanges()
+ {
+ }
+ }
+}
File [modified]: InvocationMethodInvocationTargetTestCase.cs
Delta lines: +0 -0
===================================================================
Directory: /DynamicProxy/trunk/src/Castle.DynamicProxy.Tests/GenClasses/
========================================================================
File [added]: GenClassWithExplicitImpl.cs
Delta lines: +11 -2
===================================================================
---
DynamicProxy/trunk/src/Castle.DynamicProxy.Tests/InvocationMethodInvocationTargetTestCase.cs
2009-11-12 16:32:24 UTC (rev 6315)
+++
DynamicProxy/trunk/src/Castle.DynamicProxy.Tests/InvocationMethodInvocationTargetTestCase.cs
2009-11-12 20:21:18 UTC (rev 6316)
@@ -14,12 +14,12 @@
namespace Castle.DynamicProxy.Tests
{
+ using System.ComponentModel;
using System.Reflection;
-
using Castle.DynamicProxy.Tests.Classes;
+ using Castle.DynamicProxy.Tests.GenClasses;
using Castle.DynamicProxy.Tests.Interceptors;
using Castle.DynamicProxy.Tests.InterClasses;
-
using NUnit.Framework;
[TestFixture]
@@ -96,5 +96,14 @@
Assert.AreSame(methodOnTarget1, invocationTarget1);
Assert.AreSame(methodOnTarget2, invocationTarget2);
}
+
+ [Test, Ignore]
+ public void
ClassProxyForGeneric_MethodInvocationTarget_should_be_proxyMethod()
+ {
+ var interceptor = new KeepDataInterceptor();
+ var proxy =
(IChangeTracking)generator.CreateClassProxy<GenClassWithExplicitImpl<int>>(interceptor);
+ Assert.IsTrue(proxy.IsChanged);
+
Assert.IsNotNull(interceptor.Invocation.MethodInvocationTarget);
+ }
}
}
--
You received this message because you are subscribed to the Google Groups
"Castle Project Commits" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/castle-project-commits?hl=.