public void TestShutdownTwice() { IEventModule anotherEventModule = new EventModule(); anotherEventModule.MainThreadId = Thread.CurrentThread.ManagedThreadId; anotherEventModule.Init(); anotherEventModule.ShutDown(); Assert.Throws <InvalidOperationException>(() => anotherEventModule.ShutDown()); }
public void TestUseWithoutInit() { IEventModule anotherEventModule = new EventModule(); anotherEventModule.MainThreadId = Thread.CurrentThread.ManagedThreadId; Assert.Throws <InvalidOperationException>(() => anotherEventModule.SendEvent(null, new OneSimpleEventArgs())); Assert.Throws <InvalidOperationException>(() => anotherEventModule.ShutDown()); }