/// <summary>
        /// Uns the register node.
        /// </summary>
        /// <param name="seleniumNode">The selenium node.</param>
        public void UnregisterNode(SeleniumNode seleniumNode)
        {
            if (!registeredNodes.Contains(seleniumNode))
            {
                return;
            }

            seleniumNode.StopProcess();
        }
        public void GetCommandLineArgumentsTest()
        {
            var node          = new SeleniumNode();
            var privateHelper = new PrivateObject(node);
            var result        = (string)privateHelper.Invoke("GetCommandLineArguments");

            TestContext.WriteLine($"Result: {result}");

            // Verify the results aren't empty/null.
            Assert.IsFalse(String.IsNullOrEmpty(result));

            // Must have the hub flag defined.
            StringAssert.Matches(result, new Regex(@"\s-hub\shttp:[^\s]+"));

            // Shouldn't contain more than one consecutive space.
            StringAssert.DoesNotMatch(result, new Regex(@"\s{2,}"));
        }
        /// <summary>
        /// Registers the node. Will over-write the
        /// <c>SeleniumNodeOptions.Hub</c> property with the hubs
        /// 'register node' url.
        /// </summary>
        /// <param name="seleniumNodeOptions">The selenium node.</param>
        /// <returns>The created selenium node.</returns>
        public SeleniumNode RegisterNode(SeleniumNodeOptions seleniumNodeOptions)
        {
            if (seleniumNodeOptions == null)
            {
                throw new ArgumentNullException(nameof(seleniumNodeOptions));
            }
            else if (WrappedProcess == null)
            {
                throw new Exception("Hub hasn't been started yet.");
            }

            // Assign the register url to the hub property.
            seleniumNodeOptions.Hub = NodeRegisterUrl.ToString();
            var seleniumNode = new SeleniumNode(seleniumNodeOptions);

            seleniumNode.StartProcess();
            registeredNodes.Add(seleniumNode);

            return(seleniumNode);
        }