예제 #1
0
        /// <summary>
        /// Get the required status checks contexts for the specified branch
        /// </summary>
        /// <remarks>
        /// See the <a href="https://developer.github.com/v3/repos/branches/#list-required-status-checks-contexts-of-protected-branch">API documentation</a> for more details
        /// </remarks>
        /// <param name="owner">The owner of the repository</param>
        /// <param name="name">The name of the repository</param>
        /// <param name="branch">The name of the branch</param>
        public IObservable <string> GetRequiredStatusChecksContexts(string owner, string name, string branch)
        {
            Ensure.ArgumentNotNullOrEmptyString(owner, "owner");
            Ensure.ArgumentNotNullOrEmptyString(name, "name");
            Ensure.ArgumentNotNullOrEmptyString(branch, "branch");

            return(_client.GetRequiredStatusChecksContexts(owner, name, branch).ToObservable().SelectMany(x => x));
        }
        public async Task GetsRequiredStatusChecksContexts()
        {
            var repoOwner = _userRepoContext.RepositoryOwner;
            var repoName  = _userRepoContext.RepositoryName;
            var requiredStatusChecksContexts = await _client.GetRequiredStatusChecksContexts(repoOwner, repoName, "master");

            Assert.NotNull(requiredStatusChecksContexts);
            Assert.Equal(2, requiredStatusChecksContexts.Count);
        }