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

GetAddMethod() private method

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

            MethodInfo addMethod = eventInfo.AddMethod;
            Assert.Equal(addMethod, eventInfo.GetAddMethod(true));
            if (addMethod != null)
            {
                Assert.Equal("add_" + name, addMethod.Name);
                Assert.Equal(1, addMethod.GetParameters().Length);
                Assert.Equal(typeof(void), addMethod.ReturnParameter.ParameterType);
            }
        }