Skip to content

Commit dec2f73

Browse files
committed
Tidy up types related to test report
1 parent c8c0239 commit dec2f73

File tree

9 files changed

+291
-244
lines changed

9 files changed

+291
-244
lines changed

NGitLab.Mock.Tests/PipelineTests.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ public void Test_pipelines_testreport_summary()
3434
var pipeline = project.Pipelines.Add(commit.Sha, JobStatus.Success, user);
3535
pipeline.TestReportsSummary = new TestReportSummary
3636
{
37-
Total = new TestReportSummaryTotals
37+
Total = new TestReportSummary.Totals
3838
{
3939
Time = 60,
4040
Count = 1157,

NGitLab/Models/TestCases.cs

Lines changed: 0 additions & 27 deletions
This file was deleted.

NGitLab/Models/TestReport.cs

Lines changed: 53 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33

44
namespace NGitLab.Models;
55

6-
public class TestReport
6+
public sealed record TestReport
77
{
88
[JsonPropertyName("total_time")]
99
public double TotalTime { get; set; }
@@ -24,5 +24,56 @@ public class TestReport
2424
public int ErrorCount { get; set; }
2525

2626
[JsonPropertyName("test_suites")]
27-
public IReadOnlyCollection<TestSuites> TestSuites { get; set; }
27+
public IReadOnlyCollection<TestSuite> TestSuites { get; set; }
28+
29+
public sealed record TestSuite
30+
{
31+
[JsonPropertyName("name")]
32+
public string Name { get; set; }
33+
34+
[JsonPropertyName("total_time")]
35+
public double TotalTime { get; set; }
36+
37+
[JsonPropertyName("total_count")]
38+
public int TotalCount { get; set; }
39+
40+
[JsonPropertyName("success_count")]
41+
public int SuccessCount { get; set; }
42+
43+
[JsonPropertyName("failed_count")]
44+
public int FailedCount { get; set; }
45+
46+
[JsonPropertyName("skipped_count")]
47+
public int SkippedCount { get; set; }
48+
49+
[JsonPropertyName("error_count")]
50+
public int ErrorCount { get; set; }
51+
52+
[JsonPropertyName("test_cases")]
53+
public IReadOnlyCollection<TestCase> TestCases { get; set; }
54+
}
55+
56+
public sealed record TestCase
57+
{
58+
[JsonPropertyName("status")]
59+
public string Status { get; set; }
60+
61+
[JsonPropertyName("name")]
62+
public string Name { get; set; }
63+
64+
[JsonPropertyName("classname")]
65+
public string Classname { get; set; }
66+
67+
[JsonPropertyName("file")]
68+
public string File { get; set; }
69+
70+
[JsonPropertyName("execution_time")]
71+
public double ExecutionTime { get; set; }
72+
73+
[JsonPropertyName("system_output")]
74+
public string SystemOutput { get; set; }
75+
76+
[JsonPropertyName("stack_trace")]
77+
public string StrackTrace { get; set; }
78+
}
2879
}

NGitLab/Models/TestReportSummary.cs

Lines changed: 48 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,56 @@
33

44
namespace NGitLab.Models;
55

6-
public record TestReportSummary
6+
public sealed record TestReportSummary
77
{
88
[JsonPropertyName("total")]
9-
public TestReportSummaryTotals Total { get; set; }
9+
public Totals Total { get; set; }
1010

1111
[JsonPropertyName("test_suites")]
12-
public IReadOnlyCollection<TestSuites> TestSuites { get; set; }
12+
public IReadOnlyCollection<TestSuite> TestSuites { get; set; }
13+
14+
public sealed record Totals
15+
{
16+
[JsonPropertyName("time")]
17+
public double Time { get; set; }
18+
19+
[JsonPropertyName("count")]
20+
public int Count { get; set; }
21+
22+
[JsonPropertyName("success")]
23+
public int Success { get; set; }
24+
25+
[JsonPropertyName("failed")]
26+
public int Failed { get; set; }
27+
28+
[JsonPropertyName("skipped")]
29+
public int Skipped { get; set; }
30+
31+
[JsonPropertyName("error")]
32+
public int Error { get; set; }
33+
}
34+
35+
public sealed record TestSuite
36+
{
37+
[JsonPropertyName("name")]
38+
public string Name { get; set; }
39+
40+
[JsonPropertyName("total_time")]
41+
public double TotalTime { get; set; }
42+
43+
[JsonPropertyName("total_count")]
44+
public int TotalCount { get; set; }
45+
46+
[JsonPropertyName("success_count")]
47+
public int SuccessCount { get; set; }
48+
49+
[JsonPropertyName("failed_count")]
50+
public int FailedCount { get; set; }
51+
52+
[JsonPropertyName("skipped_count")]
53+
public int SkippedCount { get; set; }
54+
55+
[JsonPropertyName("error_count")]
56+
public int ErrorCount { get; set; }
57+
}
1358
}

NGitLab/Models/TestReportSummaryTotals.cs

Lines changed: 0 additions & 24 deletions
This file was deleted.

NGitLab/Models/TestSuites.cs

Lines changed: 0 additions & 31 deletions
This file was deleted.

NGitLab/PublicAPI/net472/PublicAPI.Unshipped.txt

Lines changed: 63 additions & 52 deletions
Original file line numberDiff line numberDiff line change
@@ -4633,22 +4633,6 @@ NGitLab.Models.TagQuery.Search.set -> void
46334633
NGitLab.Models.TagQuery.Sort.get -> string
46344634
NGitLab.Models.TagQuery.Sort.set -> void
46354635
NGitLab.Models.TagQuery.TagQuery() -> void
4636-
NGitLab.Models.TestCases
4637-
NGitLab.Models.TestCases.Classname.get -> string
4638-
NGitLab.Models.TestCases.Classname.set -> void
4639-
NGitLab.Models.TestCases.ExecutionTime.get -> double
4640-
NGitLab.Models.TestCases.ExecutionTime.set -> void
4641-
NGitLab.Models.TestCases.File.get -> string
4642-
NGitLab.Models.TestCases.File.set -> void
4643-
NGitLab.Models.TestCases.Name.get -> string
4644-
NGitLab.Models.TestCases.Name.set -> void
4645-
NGitLab.Models.TestCases.Status.get -> string
4646-
NGitLab.Models.TestCases.Status.set -> void
4647-
NGitLab.Models.TestCases.StrackTrace.get -> string
4648-
NGitLab.Models.TestCases.StrackTrace.set -> void
4649-
NGitLab.Models.TestCases.SystemOutput.get -> string
4650-
NGitLab.Models.TestCases.SystemOutput.set -> void
4651-
NGitLab.Models.TestCases.TestCases() -> void
46524636
NGitLab.Models.TestReport
46534637
NGitLab.Models.TestReport.ErrorCount.get -> int
46544638
NGitLab.Models.TestReport.ErrorCount.set -> void
@@ -4658,50 +4642,77 @@ NGitLab.Models.TestReport.SkippedCount.get -> int
46584642
NGitLab.Models.TestReport.SkippedCount.set -> void
46594643
NGitLab.Models.TestReport.SuccessCount.get -> int
46604644
NGitLab.Models.TestReport.SuccessCount.set -> void
4661-
NGitLab.Models.TestReport.TestReport() -> void
4662-
NGitLab.Models.TestReport.TestSuites.get -> System.Collections.Generic.IReadOnlyCollection<NGitLab.Models.TestSuites>
4645+
NGitLab.Models.TestReport.TestCase
4646+
NGitLab.Models.TestReport.TestCase.Classname.get -> string
4647+
NGitLab.Models.TestReport.TestCase.Classname.set -> void
4648+
NGitLab.Models.TestReport.TestCase.ExecutionTime.get -> double
4649+
NGitLab.Models.TestReport.TestCase.ExecutionTime.set -> void
4650+
NGitLab.Models.TestReport.TestCase.File.get -> string
4651+
NGitLab.Models.TestReport.TestCase.File.set -> void
4652+
NGitLab.Models.TestReport.TestCase.Name.get -> string
4653+
NGitLab.Models.TestReport.TestCase.Name.set -> void
4654+
NGitLab.Models.TestReport.TestCase.Status.get -> string
4655+
NGitLab.Models.TestReport.TestCase.Status.set -> void
4656+
NGitLab.Models.TestReport.TestCase.StrackTrace.get -> string
4657+
NGitLab.Models.TestReport.TestCase.StrackTrace.set -> void
4658+
NGitLab.Models.TestReport.TestCase.SystemOutput.get -> string
4659+
NGitLab.Models.TestReport.TestCase.SystemOutput.set -> void
4660+
NGitLab.Models.TestReport.TestSuite
4661+
NGitLab.Models.TestReport.TestSuite.ErrorCount.get -> int
4662+
NGitLab.Models.TestReport.TestSuite.ErrorCount.set -> void
4663+
NGitLab.Models.TestReport.TestSuite.FailedCount.get -> int
4664+
NGitLab.Models.TestReport.TestSuite.FailedCount.set -> void
4665+
NGitLab.Models.TestReport.TestSuite.Name.get -> string
4666+
NGitLab.Models.TestReport.TestSuite.Name.set -> void
4667+
NGitLab.Models.TestReport.TestSuite.SkippedCount.get -> int
4668+
NGitLab.Models.TestReport.TestSuite.SkippedCount.set -> void
4669+
NGitLab.Models.TestReport.TestSuite.SuccessCount.get -> int
4670+
NGitLab.Models.TestReport.TestSuite.SuccessCount.set -> void
4671+
NGitLab.Models.TestReport.TestSuite.TestCases.get -> System.Collections.Generic.IReadOnlyCollection<NGitLab.Models.TestReport.TestCase>
4672+
NGitLab.Models.TestReport.TestSuite.TestCases.set -> void
4673+
NGitLab.Models.TestReport.TestSuite.TotalCount.get -> int
4674+
NGitLab.Models.TestReport.TestSuite.TotalCount.set -> void
4675+
NGitLab.Models.TestReport.TestSuite.TotalTime.get -> double
4676+
NGitLab.Models.TestReport.TestSuite.TotalTime.set -> void
4677+
NGitLab.Models.TestReport.TestSuites.get -> System.Collections.Generic.IReadOnlyCollection<NGitLab.Models.TestReport.TestSuite>
46634678
NGitLab.Models.TestReport.TestSuites.set -> void
46644679
NGitLab.Models.TestReport.TotalCount.get -> int
46654680
NGitLab.Models.TestReport.TotalCount.set -> void
46664681
NGitLab.Models.TestReport.TotalTime.get -> double
46674682
NGitLab.Models.TestReport.TotalTime.set -> void
46684683
NGitLab.Models.TestReportSummary
4669-
NGitLab.Models.TestReportSummary.TestSuites.get -> System.Collections.Generic.IReadOnlyCollection<NGitLab.Models.TestSuites>
4684+
NGitLab.Models.TestReportSummary.TestSuite
4685+
NGitLab.Models.TestReportSummary.TestSuite.ErrorCount.get -> int
4686+
NGitLab.Models.TestReportSummary.TestSuite.ErrorCount.set -> void
4687+
NGitLab.Models.TestReportSummary.TestSuite.FailedCount.get -> int
4688+
NGitLab.Models.TestReportSummary.TestSuite.FailedCount.set -> void
4689+
NGitLab.Models.TestReportSummary.TestSuite.Name.get -> string
4690+
NGitLab.Models.TestReportSummary.TestSuite.Name.set -> void
4691+
NGitLab.Models.TestReportSummary.TestSuite.SkippedCount.get -> int
4692+
NGitLab.Models.TestReportSummary.TestSuite.SkippedCount.set -> void
4693+
NGitLab.Models.TestReportSummary.TestSuite.SuccessCount.get -> int
4694+
NGitLab.Models.TestReportSummary.TestSuite.SuccessCount.set -> void
4695+
NGitLab.Models.TestReportSummary.TestSuite.TotalCount.get -> int
4696+
NGitLab.Models.TestReportSummary.TestSuite.TotalCount.set -> void
4697+
NGitLab.Models.TestReportSummary.TestSuite.TotalTime.get -> double
4698+
NGitLab.Models.TestReportSummary.TestSuite.TotalTime.set -> void
4699+
NGitLab.Models.TestReportSummary.TestSuites.get -> System.Collections.Generic.IReadOnlyCollection<NGitLab.Models.TestReportSummary.TestSuite>
46704700
NGitLab.Models.TestReportSummary.TestSuites.set -> void
4671-
NGitLab.Models.TestReportSummary.Total.get -> NGitLab.Models.TestReportSummaryTotals
4701+
NGitLab.Models.TestReportSummary.Total.get -> NGitLab.Models.TestReportSummary.Totals
46724702
NGitLab.Models.TestReportSummary.Total.set -> void
4673-
NGitLab.Models.TestReportSummaryTotals
4674-
NGitLab.Models.TestReportSummaryTotals.Count.get -> int
4675-
NGitLab.Models.TestReportSummaryTotals.Count.set -> void
4676-
NGitLab.Models.TestReportSummaryTotals.Error.get -> int
4677-
NGitLab.Models.TestReportSummaryTotals.Error.set -> void
4678-
NGitLab.Models.TestReportSummaryTotals.Failed.get -> int
4679-
NGitLab.Models.TestReportSummaryTotals.Failed.set -> void
4680-
NGitLab.Models.TestReportSummaryTotals.Skipped.get -> int
4681-
NGitLab.Models.TestReportSummaryTotals.Skipped.set -> void
4682-
NGitLab.Models.TestReportSummaryTotals.Success.get -> int
4683-
NGitLab.Models.TestReportSummaryTotals.Success.set -> void
4684-
NGitLab.Models.TestReportSummaryTotals.TestReportSummaryTotals() -> void
4685-
NGitLab.Models.TestReportSummaryTotals.Time.get -> double
4686-
NGitLab.Models.TestReportSummaryTotals.Time.set -> void
4687-
NGitLab.Models.TestSuites
4688-
NGitLab.Models.TestSuites.ErrorCount.get -> int
4689-
NGitLab.Models.TestSuites.ErrorCount.set -> void
4690-
NGitLab.Models.TestSuites.FailedCount.get -> int
4691-
NGitLab.Models.TestSuites.FailedCount.set -> void
4692-
NGitLab.Models.TestSuites.Name.get -> string
4693-
NGitLab.Models.TestSuites.Name.set -> void
4694-
NGitLab.Models.TestSuites.SkippedCount.get -> int
4695-
NGitLab.Models.TestSuites.SkippedCount.set -> void
4696-
NGitLab.Models.TestSuites.SuccessCount.get -> int
4697-
NGitLab.Models.TestSuites.SuccessCount.set -> void
4698-
NGitLab.Models.TestSuites.TestCases.get -> System.Collections.Generic.IReadOnlyCollection<NGitLab.Models.TestCases>
4699-
NGitLab.Models.TestSuites.TestCases.set -> void
4700-
NGitLab.Models.TestSuites.TestSuites() -> void
4701-
NGitLab.Models.TestSuites.TotalCount.get -> int
4702-
NGitLab.Models.TestSuites.TotalCount.set -> void
4703-
NGitLab.Models.TestSuites.TotalTime.get -> double
4704-
NGitLab.Models.TestSuites.TotalTime.set -> void
4703+
NGitLab.Models.TestReportSummary.Totals
4704+
NGitLab.Models.TestReportSummary.Totals.Count.get -> int
4705+
NGitLab.Models.TestReportSummary.Totals.Count.set -> void
4706+
NGitLab.Models.TestReportSummary.Totals.Error.get -> int
4707+
NGitLab.Models.TestReportSummary.Totals.Error.set -> void
4708+
NGitLab.Models.TestReportSummary.Totals.Failed.get -> int
4709+
NGitLab.Models.TestReportSummary.Totals.Failed.set -> void
4710+
NGitLab.Models.TestReportSummary.Totals.Skipped.get -> int
4711+
NGitLab.Models.TestReportSummary.Totals.Skipped.set -> void
4712+
NGitLab.Models.TestReportSummary.Totals.Success.get -> int
4713+
NGitLab.Models.TestReportSummary.Totals.Success.set -> void
4714+
NGitLab.Models.TestReportSummary.Totals.Time.get -> double
4715+
NGitLab.Models.TestReportSummary.Totals.Time.set -> void
47054716
NGitLab.Models.TimeStats
47064717
NGitLab.Models.TimeStats.HumanTimeEstimate.get -> string
47074718
NGitLab.Models.TimeStats.HumanTimeEstimate.set -> void

0 commit comments

Comments
 (0)