Пример #1
0
        /// <summary>
        /// Gets a single Label by name.
        /// </summary>
        /// <remarks>
        /// See the <a href="http://developer.github.com/v3/issues/labels/#get-a-single-label">API documentation</a> for more information.
        /// </remarks>
        /// <param name="owner">The owner of the repository</param>
        /// <param name="name">The name of the repository</param>
        /// <param name="labelName">The name of the label</param>
        public IObservable <Label> Get(string owner, string name, string labelName)
        {
            Ensure.ArgumentNotNullOrEmptyString(owner, nameof(owner));
            Ensure.ArgumentNotNullOrEmptyString(name, nameof(name));
            Ensure.ArgumentNotNullOrEmptyString(labelName, nameof(labelName));

            return(_client.Get(owner, name, labelName).ToObservable());
        }
Пример #2
0
    public async Task CanRetrieveIssueLabelByName()
    {
        var newLabel = new NewLabel("test label 1b", "FFFFFF");
        var label    = await _issuesLabelsClient.Create(_context.RepositoryOwner, _context.RepositoryName, newLabel);

        Assert.NotNull(label);

        var issueLabelLookupByName = await _issuesLabelsClient.Get(_context.RepositoryOwner, _context.RepositoryName, label.Name);

        Assert.Equal(label.Name, issueLabelLookupByName.Name);
        Assert.Equal(label.Color, issueLabelLookupByName.Color);
        Assert.Equal(label.Description, issueLabelLookupByName.Description);
    }
Пример #3
0
 /// <summary>
 /// Gets a single Label by name.
 /// </summary>
 /// <remarks>
 /// See the <a href="http://developer.github.com/v3/issues/labels/#get-a-single-label">API documentation</a> for more information.
 /// </remarks>
 /// <param name="owner">The owner of the repository</param>
 /// <param name="repo">The name of the repository</param>
 /// <param name="name">The name of the label</param>
 /// <returns>The label</returns>
 public IObservable <Label> Get(string owner, string repo, string name)
 {
     return(_client.Get(owner, repo, name).ToObservable());
 }