System.Reflection.Tests.EventInfoTests.GetRemoveMethod C# (CSharp) Method

GetRemoveMethod() private method

private GetRemoveMethod ( Type type, string name, bool isVisible ) : void
type Type
name string
isVisible bool
return void
        public void GetRemoveMethod(Type type, string name, bool isVisible)
        {
            EventInfo eventInfo = GetEventInfo(type, name);
            Assert.Equal(isVisible, eventInfo.GetRemoveMethod() != null);
            Assert.Equal(isVisible, eventInfo.GetRemoveMethod(false) != null);
            Assert.NotNull(eventInfo.GetRemoveMethod(true));

            MethodInfo removeMethod = eventInfo.RemoveMethod;
            Assert.Equal(removeMethod, eventInfo.GetRemoveMethod(true));
            if (removeMethod != null)
            {
                Assert.Equal("remove_" + name, removeMethod.Name);
                Assert.Equal(1, removeMethod.GetParameters().Length);
                Assert.Equal(typeof(void), removeMethod.ReturnParameter.ParameterType);
            }
        }