Exemplo n.º 1
0
        public void FindAddMethod_WhenNoMethod_ReturnsNull()
        {
            EventDef member = Create();

            MethodDef result = member.FindAddMethod();

            Assert.IsNull(result);
        }
Exemplo n.º 2
0
        public void FindAddMethod_WhenHasAdd_FindsMethod()
        {
            EventDef member = Create();

            MethodDef add = CreateEventMethod("add", MethodAttributes.Private);

            _container.Methods.Add(add);

            MethodDef result = member.FindAddMethod();

            Assert.AreSame(add, result);
        }
Exemplo n.º 3
0
 /// <summary>
 /// Initialises a new instance of the EventSyntax class.
 /// </summary>
 /// <param name="eventDef">The details of the event to get the information from.</param>
 public EventSyntax(EventDef eventDef)
 {
     _eventDef = eventDef;
     _add      = eventDef.FindAddMethod();
     _remove   = eventDef.FindRemoveMethod();
 }