public void ThrowsInvalidOperationExceptionWhenEverythingIsStatic() { ExceptionTester.CallMethodAndExpectException <InvalidOperationException>(() => WeakEventListener <EventListener, EventSource, EventArgs> .SubscribeToWeakGenericEvent(null, null, "StaticEvent", EventListener.OnEventStaticHandler)); }
public void ThrowsArgumentNullExceptionForNullSource() { var listener = new EventListener(); ExceptionTester.CallMethodAndExpectException <ArgumentNullException>(() => listener.SubscribeToWeakGenericEvent <ViewModelClosedEventArgs>(null, "event", listener.OnPublicEvent)); }
public void ThrowsArgumentNullExceptionForNullUri() { ExceptionTester.CallMethodAndExpectException <ArgumentNullException>(() => UriExtensions.GetSafeUriString(null)); }