public void AddRemoveHandlerTest() { var manager = new WeakEventManager <EventArgs>(); var validated = false; EventHandler <EventArgs> handler = (s, e) => { Assert.Equal(s, this); validated = true; }; manager.Add(handler); manager.Invoke(this, new EventArgs()); Assert.True(validated); validated = false; manager.Remove(handler); manager.Invoke(this, new EventArgs()); Assert.False(validated); }