コード例 #1
0
        public void TestDisposedServiceThrowsException()
        {
            JsonRpcServer server = new JsonRpcServer("nats://127.0.0.1", 5000);

            server.Dispose();
            JsonRpcRequest request = new JsonRpcRequest
            {
                Method     = "test:channel",
                Id         = Guid.NewGuid().ToString(),
                Parameters = new Dictionary <string, string>
                {
                    { "data", "ping" }
                }
            };

            Assert.Throws <ObjectDisposedException>(() => server.Serve(request));
        }