Files
octokit.net/Octokit/Models/Response/Commit.cs
tasadar2 3345f76fc9 Adding a convention test to detect whether a model has a constructor exposing all properties (#1798)
* Added a convention test to detect a model constructor exposing all properties

* add ctors to classes where they are missing

* rename ctor parameters that dont match properties

* add missing parameters to existing ctors

* add specific PunchCard ctor to allow mocking, and update test to resolve call ambiguity

* Added base class properties to the convention test

Added member exclusion attribute

* Updated newly offending classes

2 excludes and 2 ctors

* rename exclusion attribute to be a bit shorter
2018-04-25 21:03:13 +10:00

42 lines
1.3 KiB
C#

using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Diagnostics;
using System.Linq;
namespace Octokit
{
[DebuggerDisplay("{DebuggerDisplay,nq}")]
public class Commit : GitReference
{
public Commit() { }
public Commit(string url, string label, string @ref, string sha, User user, Repository repository, string message, Committer author, Committer committer, GitReference tree, IEnumerable<GitReference> parents, int commentCount, Verification verification)
: base(url, label, @ref, sha, user, repository)
{
Ensure.ArgumentNotNull(parents, nameof(parents));
Message = message;
Author = author;
Committer = committer;
Tree = tree;
Parents = new ReadOnlyCollection<GitReference>(parents.ToList());
CommentCount = commentCount;
Verification = verification;
}
public string Message { get; protected set; }
public Committer Author { get; protected set; }
public Committer Committer { get; protected set; }
public GitReference Tree { get; protected set; }
public IReadOnlyList<GitReference> Parents { get; protected set; }
public int CommentCount { get; protected set; }
public Verification Verification { get; protected set; }
}
}