Update of /cvsroot/springnet/Spring.Net/test/Spring/Spring.Core.Tests/Util
In directory sc8-pr-cvs8.sourceforge.net:/tmp/cvs-serv9488
Modified Files:
ReflectionUtilsTests.cs
Log Message:
SPRNET-852 - Creating a custom attribute did not take into account public field values that match the named arguments in the attribute declaration.
Index: ReflectionUtilsTests.cs
===================================================================
RCS file: /cvsroot/springnet/Spring.Net/test/Spring/Spring.Core.Tests/Util/ReflectionUtilsTests.cs,v
retrieving revision 1.20
retrieving revision 1.21
diff -C2 -d -r1.20 -r1.21
*** ReflectionUtilsTests.cs 7 Dec 2007 17:59:51 -0000 1.20
--- ReflectionUtilsTests.cs 24 Jan 2008 04:10:44 -0000 1.21
***************
*** 25,31 ****
using System.Reflection;
using System.Reflection.Emit;
using System.Threading;
using System.Runtime.CompilerServices;
!
using NUnit.Framework;
--- 25,32 ----
using System.Reflection;
using System.Reflection.Emit;
+ using System.Runtime.InteropServices;
using System.Threading;
using System.Runtime.CompilerServices;
! using System.Windows.Forms;
using NUnit.Framework;
***************
*** 312,316 ****
--- 313,332 ----
// TODO : actually emit the attribute and check it...
}
+ #if NET_2_0
+ [Test]
+ public void CreatCustomAttriubtesFromCustomAttributeData()
+ {
+ Type control = typeof (Control);
+ MethodInfo mi = control.GetMethod("get_Font");
+ System.Collections.Generic.IList<CustomAttributeData> attributes = CustomAttributeData.GetCustomAttributes(mi.ReturnParameter);
+ CustomAttributeBuilder builder = null;
+ foreach (CustomAttributeData customAttributeData in attributes)
+ {
+ builder = ReflectionUtils.CreateCustomAttribute(customAttributeData);
+ Assert.IsNotNull(builder);
+ }
+ }
+ #endif
[Test]
public void CreateCustomAttributeUsingDefaultValuesForTheConstructor()
|