SendRequest() private method

private SendRequest ( HttpMethod method, object>.ICollection body ) : Task
method HttpMethod
body object>.ICollection
return Task
Beispiel #1
0
        void AppVeyorAddTest(string testName, string testFramework, string fileName, string outcome, long?durationMilliseconds,
                             string errorMessage, string errorStackTrace, string stdOut, string stdErr)
        {
            var body = new AddUpdateTestRequest
            {
                TestName             = testName,
                TestFramework        = testFramework,
                FileName             = fileName,
                Outcome              = outcome,
                DurationMilliseconds = durationMilliseconds,
                ErrorMessage         = errorMessage,
                ErrorStackTrace      = errorStackTrace,
                StdOut = TrimStdOut(stdOut),
                StdErr = TrimStdOut(stdErr)
            };

            try
            {
                AppVeyorClient.SendRequest(Logger, $"{baseUri}/api/tests", "POST", body);
            }
            catch (Exception ex)
            {
                Logger.LogError("Error communicating AppVeyor Build Worker API: " + ex.Message);
            }
        }
        static void AppVeyorAddTest(string testName, string testFramework, string fileName, string outcome, long?durationMilliseconds,
                                    string errorMessage, string errorStackTrace, string stdOut, string stdErr)
        {
            if (!AppVeyorClient.IsRunningInAppVeyor)
            {
                return;
            }

            var body = new AddUpdateTestRequest
            {
                TestName             = testName,
                TestFramework        = testFramework,
                FileName             = fileName,
                Outcome              = outcome,
                DurationMilliseconds = durationMilliseconds,
                ErrorMessage         = errorMessage,
                ErrorStackTrace      = errorStackTrace,
                StdOut = TrimStdOut(stdOut),
                StdErr = TrimStdOut(stdErr)
            };

            try
            {
                AppVeyorClient.SendRequest("api/tests", "POST", body);
            }
            catch (Exception ex)
            {
                Console.Error.WriteLine("Error communicating AppVeyor Build Worker API: " + ex.Message);
            }
        }
Beispiel #3
0
        void AppVeyorAddTest(string testName, string testFramework, string fileName, string outcome, long?durationMilliseconds,
                             string errorMessage, string errorStackTrace, string stdOut)
        {
            var body = new AddUpdateTestRequest
            {
                TestName             = testName,
                TestFramework        = testFramework,
                FileName             = fileName,
                Outcome              = outcome,
                DurationMilliseconds = durationMilliseconds,
                ErrorMessage         = errorMessage,
                ErrorStackTrace      = errorStackTrace,
                StdOut = TrimStdOut(stdOut),
            };

            AppVeyorClient.SendRequest(Logger, $"{baseUri}/api/tests", HttpMethod.Post, body);
        }