forked from Azure/azure-sdk-tools
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathFailedTestRunResponse.cs
More file actions
49 lines (40 loc) · 1.64 KB
/
FailedTestRunResponse.cs
File metadata and controls
49 lines (40 loc) · 1.64 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
using System.Text.Json.Serialization;
namespace Azure.Sdk.Tools.Cli.Models;
public class FailedTestRunResponse : Response
{
[JsonPropertyName("run_id")]
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingDefault)]
public int RunId { get; set; } = 0;
[JsonPropertyName("test_case_title")]
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingDefault)]
public string TestCaseTitle { get; set; }
[JsonPropertyName("error_message")]
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingDefault)]
public string ErrorMessage { get; set; }
[JsonPropertyName("stack_trace")]
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingDefault)]
public string StackTrace { get; set; }
[JsonPropertyName("outcome")]
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingDefault)]
public string Outcome { get; set; }
[JsonPropertyName("uri")]
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingDefault)]
public string Uri { get; set; }
public override string ToString()
{
var output = "";
output += $"## {TestCaseTitle}{Environment.NewLine}";
if (RunId != 0)
{
output += $"Run ID: {RunId}{Environment.NewLine}";
}
output += $"Outcome: {Outcome}{Environment.NewLine}";
if (!string.IsNullOrEmpty(Uri))
{
output += $"URI: {Uri}{Environment.NewLine}";
}
output += $"{Environment.NewLine}### Stack Trace{Environment.NewLine}{StackTrace}{Environment.NewLine}";
output += $"### Error Message{Environment.NewLine}{ErrorMessage}{Environment.NewLine}";
return ToString(output);
}
}