Esempio n. 1
0
        /// <summary>
        /// Create a tag for a given repository
        /// </summary>
        /// <remarks>
        /// http://developer.github.com/v3/git/tags/#create-a-tag-object
        /// </remarks>
        /// <param name="owner">The owner of the repository</param>
        /// <param name="name">The name of the repository</param>
        /// <param name="tag">The tag to create</param>
        public IObservable <GitTag> Create(string owner, string name, NewTag tag)
        {
            Ensure.ArgumentNotNullOrEmptyString(owner, nameof(owner));
            Ensure.ArgumentNotNullOrEmptyString(name, nameof(name));
            Ensure.ArgumentNotNull(tag, nameof(tag));

            return(_client.Create(owner, name, tag).ToObservable());
        }
Esempio n. 2
0
            public async Task CreatesTagForRepository()
            {
                var newTag = new NewTag {
                    Message = "Hello", Type = TaggedType.Blob, Object = sha, Tag = "tag"
                };

                var tag = await fixture.Create(context.Repository.Id, newTag);

                Assert.Equal(TaggedType.Blob, tag.Object.Type);
                Assert.Equal("Hello", tag.Message);
                Assert.Equal(tag.Object.Sha, sha);
            }
Esempio n. 3
0
            public async Task CreatesTagForRepository()
            {
                var newTag = new NewTag {
                    Message = "Hello", Type = TaggedType.Blob, Object = sha, Tag = "tag"
                };

                var tag = await fixture.Create(context.RepositoryOwner, context.RepositoryName, newTag);

                var gitTag = await fixture.Get(context.RepositoryOwner, context.RepositoryName, tag.Sha);

                Assert.NotNull(gitTag);
                Assert.Equal(TaggedType.Blob, gitTag.Object.Type);
                Assert.Equal("Hello", gitTag.Message);
                Assert.Equal(gitTag.Object.Sha, sha);
            }