This repository was archived by the owner on Dec 3, 2019. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathCreateCheckRun.cs
More file actions
55 lines (47 loc) · 1.96 KB
/
CreateCheckRun.cs
File metadata and controls
55 lines (47 loc) · 1.96 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
50
51
52
53
54
55
using System;
using System.Linq;
using System.Threading;
namespace BCC.Core.Model.CheckRunSubmission
{
public class CreateCheckRun : IEquatable<CreateCheckRun>
{
public string Name { get; set; }
public string Title { get; set; }
public string Summary { get; set; }
public string Text { get; set; }
public CheckConclusion Conclusion { get; set; }
public Annotation[] Annotations { get; set; }
public CheckRunImage[] Images { get; set; }
public DateTimeOffset StartedAt { get; set; }
public DateTimeOffset CompletedAt { get; set; }
public CreateCheckRun()
{
}
public CreateCheckRun(string name, string title, string summary, CheckConclusion conclusion, DateTimeOffset startedAt, DateTimeOffset completedAt)
{
Name = name ?? throw new ArgumentNullException(nameof(name));
Title = title ?? throw new ArgumentNullException(nameof(title));
Summary = summary ?? throw new ArgumentNullException(nameof(summary));
Conclusion = conclusion;
StartedAt = startedAt;
CompletedAt = completedAt;
}
public bool Equals(CreateCheckRun other)
{
if (other == null)
return false;
var b = Name == other.Name &&
Title == other.Title &&
Summary == other.Summary &&
Text == other.Text &&
Conclusion == other.Conclusion &&
StartedAt == other.StartedAt &&
CompletedAt == other.CompletedAt;
var c = (Annotations == null) == (other.Annotations == null) &&
(Annotations == null || Annotations.SequenceEqual(other.Annotations));
var d = (Images == null) == (other.Images == null) &&
(Images == null || Images.SequenceEqual(other.Images));
return b && c && d;
}
}
}