/// <summary>
        /// Deletes an existing <see cref="Release"/> for the specified repository.
        /// </summary>
        /// <remarks>
        /// See the <a href="http://developer.github.com/v3/repos/releases/#delete-a-release">API documentation</a> for more information.
        /// </remarks>
        /// <param name="owner">The repository's owner</param>
        /// <param name="name">The repository's name</param>
        /// <param name="id">The id of the release to delete</param>
        /// <exception cref="ApiException">Thrown when a general API error occurs.</exception>
        public IObservable <Unit> Delete(string owner, string name, int id)
        {
            Ensure.ArgumentNotNullOrEmptyString(owner, "owner");
            Ensure.ArgumentNotNullOrEmptyString(name, "name");

            return(_client.Delete(owner, name, id).ToObservable());
        }
示例#2
0
        public async Task CanDelete()
        {
            var releaseWithNoUpdate = new NewRelease("0.1")
            {
                Draft = true
            };
            var release = await _releaseClient.Create(_context.RepositoryOwner, _context.RepositoryName, releaseWithNoUpdate);

            var createdRelease = await _releaseClient.Get(_context.RepositoryOwner, _context.RepositoryName, release.Id);

            Assert.NotNull(createdRelease);

            await _releaseClient.Delete(_context.RepositoryOwner, _context.RepositoryName, createdRelease.Id);

            await Assert.ThrowsAsync <NotFoundException>(async() => await _releaseClient.Get(_context.RepositoryOwner, _context.RepositoryName, createdRelease.Id));
        }