public void JobRefreshTest()
        {
            var cli = Command.Splunk("search");

            cli.AddRule("search", typeof(string), "search string");
            cli.Opts["search"] = "search index=_internal * | head 10 ";

            var service = new Service(Scheme.Https, "localhost", 8089);

            service.LoginAsync("admin", "changeme").Wait();
            var job = service.CreateJobAsync((string)cli.Opts["search"]).Result;

            Stopwatch stopwatch = new Stopwatch();

            stopwatch.Start();
            TimeSpan max = new TimeSpan(0, 0, 0, 10);

            while (!job.IsDone)
            {
                Thread.Sleep(1000);

                //has to call this to get the job.IsCompleted
                job.GetAsync().Wait();
                Console.WriteLine("jobUpdated={0}", job.Updated);

                if (stopwatch.Elapsed > max)
                {
                    Assert.False(true, string.Format("The job is not finished within expected time {0} seconds", max.TotalSeconds));
                }
            }

            job.CancelAsync().Wait();
        }
        /// <summary>
        /// Initializes a new instance of the <see cref="TestHelper"/> class.
        /// </summary>
        public TestHelper()
        {
            ServicePointManager.ServerCertificateValidationCallback += (sender, certificate, chain, sslPolicyErrors) =>
            {
                return(true);
            };

            this.command = Command.Splunk();
        }
 /// <summary>
 /// Returns the command object, which picks up .splunkrc
 /// </summary>
 /// <returns>The command object</returns>
 public Command SetUp()
 {
     this.command = Command.Splunk();
     return(this.command);
 }