public void DisconnectsMessaging()
            {
                Client.Shutdown();

                MessagingClient.Received(1).Dispose();
                MessageTransport.Received(1).Dispose();
            }
            public void SendsRequest()
            {
                Client.Ping(TimeSpan.FromMilliseconds(0));

                MessagingClient.Received(1).SendMessageAsync <PingRequest, PingResponse>(
                    Arg.Any <PingRequest>());
            }
            public void SendsRequestWithParams()
            {
                var @params = new FindProcessByIdParams
                {
                    id = new Random().Next(10000),
                };

                Client.FindProcessById(@params);

                MessagingClient.Received(1).SendMessageAsync <FindProcessByIdRequest, FindProcessByIdResponse>(
                    Arg.Is <FindProcessByIdRequest>(request => request.@params == @params)
                    );
            }
            public void SendsRequestWithParams()
            {
                var @params = new CreateProcessParams
                {
                    executablePath = "foo.exe",
                };

                Client.CreateProcess(@params);

                MessagingClient.Received(1).SendMessageAsync <CreateProcessRequest, CreateProcessResponse>(
                    Arg.Is <CreateProcessRequest>(request =>
                                                  request.@params == @params
                                                  )
                    );
            }
            public void SendsRequestWithParams()
            {
                var @params = new WaitForProcessExitParams
                {
                    key     = Guid.NewGuid(),
                    timeout = 5000,
                };

                Client.WaitForProcessExit(@params);

                MessagingClient.Received(1).SendMessageAsync <WaitForProcessExitRequest, WaitForProcessExitResponse>(
                    Arg.Is <WaitForProcessExitRequest>(request =>
                                                       request.@params == @params
                                                       )
                    );
            }