Beispiel #1
0
 public void Test_Unregister_Before_Register()
 {
     using (DdeServer server = new TestServer(ServiceName))
     {
         Assert.Throws<InvalidOperationException>(() => server.Unregister());
     }
 }
Beispiel #2
0
 public void Test_Unregister_Before_Register()
 {
     using (DdeServer server = new TestServer(ServiceName))
     {
         server.Unregister();
     }
 }
 public void Test_Unregister_After_Dispose()
 {
     using DdeServer server = new TestServer(ServiceName);
     server.Register();
     server.Dispose();
     Assert.Throws<ObjectDisposedException>(() => server.Unregister());
 }
Beispiel #4
0
 public void Test_Unregister_After_Dispose()
 {
     using (DdeServer server = new TestServer(ServiceName))
     {
         server.Register();
         server.Dispose();
         server.Unregister();
     }
 }
        public void Test_Unregister()
        {
            using var context = new DdeContext();
            var listener = new EventListener();
            context.Unregister += listener.OnEvent;
            context.Initialize();
            using (DdeServer server = new TestServer(ServiceName))
            {
                server.Register();
                server.Unregister();
            }

            Assert.IsTrue(listener.Received.WaitOne(Timeout, false));
        }
 public void Test_Unregister()
 {
     using DdeServer server = new TestServer(ServiceName);
     server.Register();
     server.Unregister();
     using var client = new DdeClient(ServiceName, TopicName);
     try
     {
         client.Connect();
         Assert.Fail();
     }
     catch (DdeException e)
     {
         Assert.AreEqual(0x400A, e.Code);
     }
 }
 public void Test_Unregister()
 {
     using (DdeContext context = new DdeContext())
     {
         EventListener listener = new EventListener();
         context.Unregister += listener.OnEvent;
         context.Initialize();
         using (DdeServer server = new TestServer(ServiceName))
         {
             server.Register();
             server.Unregister();
         }
         Assert.IsTrue(listener.Received.WaitOne(Timeout, false));
     }
 }
 public void Test_Unregister_Before_Register()
 {
     using (DdeServer server = new TestServer(ServiceName))
     {
         server.Unregister();
     }
 }
 public void Test_Unregister_After_Dispose()
 {
     using (DdeServer server = new TestServer(ServiceName))
     {
         server.Register();
         server.Dispose();
         server.Unregister();
     }
 }
Beispiel #10
0
 public void Test_Unregister()
 {
     using (DdeServer server = new TestServer(ServiceName))
     {
         server.Register();
         server.Unregister();
         using (DdeClient client = new DdeClient(ServiceName, TopicName))
         {
             try
             {
                 client.Connect();
                 Assert.Fail();
             }
             catch (DdeException e)
             {
                 Assert.AreEqual(0x400A, e.Code);
             }
         }
     }
 }