public void ForEventAdd() { var invocationMatcher = InvocationMatcher.ForEventAdd(myObject, "Event", Any <EventHandler> .Value); Assert.AreSame(myObject, invocationMatcher.Target); Assert.AreEqual(typeof(IMyObject).GetEvent("Event").GetAddMethod(), invocationMatcher.Method); CollectionAssert.AreEqual(new object[] { Any <EventHandler> .Value }, invocationMatcher.ParameterValueConstraints); }
public IAssertInvocations ForEventAdd <TTarget, THandler>(TTarget target, string eventName, THandler handler) { return(Assert(InvocationMatcher.ForEventAdd(target, eventName, handler))); }
public void ForEventAddOnNonExistingEvent() { Assert.Throws <ArgumentException>(() => InvocationMatcher.ForEventAdd(myObject, "Event2", Any <EventHandler> .Value)); }
public ISpecifyAction EventAdd <TTarget, THandler>(TTarget target, string eventName, THandler handler) { return(ActionInvoked(InvocationMatcher.ForEventAdd(target, eventName, handler))); }