From b9fd42521d2761866e435068286dec0288575a1f Mon Sep 17 00:00:00 2001 From: Victor Zaytsev Date: Tue, 5 Dec 2017 20:09:39 +0300 Subject: [PATCH] Added test for Delegate.CreateDelegate method (dotnet/corefx#25528) * Added test for Delegate.CreateDelegate method * Ignored test for netfx. Commit migrated from https://github.com/dotnet/corefx/commit/1922cb233910536604812c5f840060e1702a0908 --- src/libraries/System.Runtime/tests/System/DelegateTests.cs | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/libraries/System.Runtime/tests/System/DelegateTests.cs b/src/libraries/System.Runtime/tests/System/DelegateTests.cs index 840402c..39314a9 100644 --- a/src/libraries/System.Runtime/tests/System/DelegateTests.cs +++ b/src/libraries/System.Runtime/tests/System/DelegateTests.cs @@ -682,6 +682,16 @@ namespace System.Tests } [Fact] + [SkipOnTargetFramework(TargetFrameworkMonikers.NetFramework, "dotnet/coreclr#15196")] + public static void CreateDelegate2_Target_GenericTypeParameter() + { + + Type theT = typeof(G<>).GetTypeInfo().GenericTypeParameters[0]; + Type delegateType = typeof(Func); + AssertExtensions.Throws("target", () => Delegate.CreateDelegate(delegateType, theT, "ReferenceEquals")); + } + + [Fact] public static void CreateDelegate2_Type_Null() { C c = new C(); -- 2.7.4