|
From: <fab...@us...> - 2011-03-20 20:35:01
|
Revision: 5482
http://nhibernate.svn.sourceforge.net/nhibernate/?rev=5482&view=rev
Author: fabiomaulo
Date: 2011-03-20 20:34:55 +0000 (Sun, 20 Mar 2011)
Log Message:
-----------
"lazy-field" interceptor proxy Serializable
Modified Paths:
--------------
trunk/nhibernate/src/NHibernate.Test/NHibernate.Test.csproj
Added Paths:
-----------
trunk/nhibernate/src/NHibernate.Test/DynamicProxyTests/LazyFieldInterceptorSerializable.cs
Added: trunk/nhibernate/src/NHibernate.Test/DynamicProxyTests/LazyFieldInterceptorSerializable.cs
===================================================================
--- trunk/nhibernate/src/NHibernate.Test/DynamicProxyTests/LazyFieldInterceptorSerializable.cs (rev 0)
+++ trunk/nhibernate/src/NHibernate.Test/DynamicProxyTests/LazyFieldInterceptorSerializable.cs 2011-03-20 20:34:55 UTC (rev 5482)
@@ -0,0 +1,37 @@
+using System;
+using Iesi.Collections.Generic;
+using NHibernate.Proxy;
+using NUnit.Framework;
+using NHibernate.Intercept;
+using SharpTestsEx;
+
+namespace NHibernate.Test.DynamicProxyTests
+{
+ public class LazyFieldInterceptorSerializable
+ {
+ [Serializable]
+ public class MyClass
+ {
+ public virtual int Id { get; set; }
+ }
+
+ [Test]
+ public void LazyFieldInterceptorMarkedAsSerializable()
+ {
+ typeof(DefaultDynamicLazyFieldInterceptor).Should().Have.Attribute<SerializableAttribute>();
+ }
+
+ [Test]
+ public void LazyFieldInterceptorIsBinarySerializable()
+ {
+ var pf = new DefaultProxyFactory();
+ var propertyInfo = typeof(MyClass).GetProperty("Id");
+ pf.PostInstantiate("MyClass", typeof(MyClass), new HashedSet<System.Type>(), propertyInfo.GetGetMethod(), propertyInfo.GetSetMethod(), null);
+ var fieldInterceptionProxy = (IFieldInterceptorAccessor)pf.GetFieldInterceptionProxy(new MyClass());
+ fieldInterceptionProxy.FieldInterceptor = new DefaultFieldInterceptor(null, null, null, "MyClass", typeof(MyClass));
+
+ fieldInterceptionProxy.Should().Be.BinarySerializable();
+ }
+
+ }
+}
\ No newline at end of file
Modified: trunk/nhibernate/src/NHibernate.Test/NHibernate.Test.csproj
===================================================================
--- trunk/nhibernate/src/NHibernate.Test/NHibernate.Test.csproj 2011-03-20 20:30:53 UTC (rev 5481)
+++ trunk/nhibernate/src/NHibernate.Test/NHibernate.Test.csproj 2011-03-20 20:34:55 UTC (rev 5482)
@@ -221,6 +221,7 @@
<Compile Include="DynamicProxyTests\InterfaceProxySerializationTests\MyProxyImpl.cs" />
<Compile Include="DynamicProxyTests\InterfaceProxySerializationTests\ProxyFixture.cs" />
<Compile Include="DynamicProxyTests\InterfaceWithEqualsGethashcodeTests.cs" />
+ <Compile Include="DynamicProxyTests\LazyFieldInterceptorSerializable.cs" />
<Compile Include="EngineTest\CallableParserFixture.cs" />
<Compile Include="EngineTest\NativeSQLQueryNonScalarReturnTest.cs" />
<Compile Include="EngineTest\NativeSQLQueryScalarReturnTest.cs" />
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|