public void TestStatusCallIsValid()
        {
            var argumentList            = DefaultArgumentList();
            StatusCallCommands commands = new StatusCallCommands(new Arguments(argumentList));

            Assert.AreEqual(true, commands.IsValid());
        }
        public void TestStatusCallIsNotValid()
        {
            String[] argumentList = DefaultArgumentList();
            argumentList[0] = "-S=";
            StatusCallCommands commands = new StatusCallCommands(new Arguments(argumentList));

            Assert.AreEqual(false, commands.IsValid());
        }
        static void Main(string[] args)
        {
            try
            {
                var commands = new StatusCallCommands(new Arguments(args));

                if (!commands.IsValid())
                {
                    Log.Instance.Error("Error parsing incoming args.");
                    Log.Instance.Debug("Args:" + args);
                    return;
                }

                //var dynamicObject = commands.ToDynamic();

                //Get Connected Force Client - as this is called statically it will connect each time.
                var clientTask = GetConnection();
                //wait until connection task has completed
                clientTask.Wait();
                //insert StatusCall object into SF. Aft Insert Trigger in SF will handle running the update.
                var insertTask = InsertStatusCallToSF(clientTask.Result,
                                                      commands.Spon,
                                                      commands.ApprovalURL,
                                                      commands.Status,
                                                      commands.OrderId,
                                                      commands.TaskId,
                                                      commands.FreelancerId,
                                                      commands.IsTest,
                                                      commands.Role);
                //wait for status call object to complete - using async and wait seems overkill here but when we extend this project to for further rest
                //operations and integrations this will become necessary.
                insertTask.Wait();

                //var task = RunSample();
                //task.Wait();
            }
            catch (Exception e)
            {
                Log.Instance.Error(e.Message, e);

                var innerException = e.InnerException;
                while (innerException != null)
                {
                    Log.Instance.Error(innerException.Message, innerException);
                    innerException = innerException.InnerException;
                }
            }
        }