Exemplo n.º 1
0
        public void TestShutdownTwice()
        {
            IEventModule anotherEventModule = new EventModule();

            anotherEventModule.MainThreadId = Thread.CurrentThread.ManagedThreadId;
            anotherEventModule.Init();
            anotherEventModule.ShutDown();
            Assert.Throws <InvalidOperationException>(() => anotherEventModule.ShutDown());
        }
Exemplo n.º 2
0
        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());
        }