nc.postNotification("test", this);
assertFalse(observer.invoked);
}
public void testRemoveObserverObjectStringObject() {
NSNotificationCenter nc = NSNotificationCenter.defaultCenter();
TestObserver observer1 = new TestObserver();
TestObserver observer2 = new TestObserver();
nc.addObserver(observer1, new NSSelector<Void>("invoked", new Class[] { NSNotification.class }), "test", null);
nc.addObserver(observer2, new NSSelector<Void>("invoked", new Class[] { NSNotification.class }), "test", null);
nc.removeObserver(observer2, "test", null);
nc.postNotification("test", this);
assertTrue(observer1.invoked);
assertFalse(observer2.invoked);
}