public void StringIsNotNullOrWhiteSpacePositive()
        {
            // act
            ArgumentCheck.StringIsNotNullOrWhiteSpace("value", nameof(ArgumentCheck));

            // assert that we don't throw exception
            Assert.True(true);
        }
 /// <inheritdoc />
 public async Task <Repository> GetRepositoryByNameAsync(
     string organizationName,
     string repositoryName)
 {
     ArgumentCheck.StringIsNotNullOrWhiteSpace(organizationName, nameof(organizationName));
     ArgumentCheck.StringIsNotNullOrWhiteSpace(repositoryName, nameof(repositoryName));
     return(await gitHubClient.Repository.Get(organizationName, repositoryName));
 }
Example #3
0
 /// <inheritdoc />
 public async Task <IReadOnlyList <GitHubCommit> > GetCommitsAsync(
     string organizationName,
     string repositoryName,
     string path = "")
 {
     ArgumentCheck.StringIsNotNullOrWhiteSpace(organizationName, nameof(organizationName));
     ArgumentCheck.StringIsNotNullOrWhiteSpace(repositoryName, nameof(repositoryName));
     return(await gitHubClient.Repository.Commit.GetAll(
                organizationName,
                repositoryName,
                new CommitRequest { Path = path }));
 }
Example #4
0
 /// <inheritdoc />
 public async Task <Blob> GetGitBlobAsync(
     string organizationName,
     string repositoryName,
     string reference)
 {
     ArgumentCheck.StringIsNotNullOrWhiteSpace(organizationName, nameof(organizationName));
     ArgumentCheck.StringIsNotNullOrWhiteSpace(repositoryName, nameof(repositoryName));
     ArgumentCheck.StringIsNotNullOrWhiteSpace(reference, nameof(reference));
     return(await gitHubClient.Git.Blob.Get(
                organizationName,
                repositoryName,
                reference));
 }
Example #5
0
 /// <inheritdoc />
 public async Task <TreeResponse> GetGitTreeRecursiveAsync(
     string organizationName,
     string repositoryName,
     string reference)
 {
     ArgumentCheck.StringIsNotNullOrWhiteSpace(organizationName, nameof(organizationName));
     ArgumentCheck.StringIsNotNullOrWhiteSpace(repositoryName, nameof(repositoryName));
     ArgumentCheck.StringIsNotNullOrWhiteSpace(reference, nameof(reference));
     return(await gitHubClient.Git.Tree.GetRecursive(
                organizationName,
                repositoryName,
                reference));
 }
Example #6
0
 /// <inheritdoc />
 public async Task <IReadOnlyList <RepositoryContent> > GetRepositoryContentByRefAsync(
     string organizationName,
     string repositoryName,
     string path,
     string reference)
 {
     ArgumentCheck.StringIsNotNullOrWhiteSpace(organizationName, nameof(organizationName));
     ArgumentCheck.StringIsNotNullOrWhiteSpace(repositoryName, nameof(repositoryName));
     ArgumentCheck.StringIsNotNullOrWhiteSpace(path, nameof(path));
     ArgumentCheck.StringIsNotNullOrWhiteSpace(reference, nameof(reference));
     return(await gitHubClient.Repository.Content.GetAllContentsByRef(
                organizationName,
                repositoryName,
                path,
                reference));
 }
Example #7
0
        /// <inheritdoc />
        public async Task DeleteFileAsync(
            string organizationName,
            string repositoryName,
            string path,
            DeleteFileRequest deleteFileRequest)
        {
            ArgumentCheck.StringIsNotNullOrWhiteSpace(organizationName, nameof(organizationName));
            ArgumentCheck.StringIsNotNullOrWhiteSpace(repositoryName, nameof(repositoryName));
            ArgumentCheck.StringIsNotNullOrWhiteSpace(path, nameof(path));

            await gitHubClient.Repository.Content.DeleteFile(
                organizationName,
                repositoryName,
                path,
                deleteFileRequest);
        }
Example #8
0
        /// <inheritdoc />
        public async Task <RepositoryContentChangeSet> CreateFileAsync(
            string organizationName,
            string repositoryName,
            string path,
            CreateFileRequest createFileRequest)
        {
            ArgumentCheck.StringIsNotNullOrWhiteSpace(organizationName, nameof(organizationName));
            ArgumentCheck.StringIsNotNullOrWhiteSpace(repositoryName, nameof(repositoryName));
            ArgumentCheck.StringIsNotNullOrWhiteSpace(path, nameof(path));

            return(await gitHubClient.Repository.Content.CreateFile(
                       organizationName,
                       repositoryName,
                       path,
                       createFileRequest));
        }
Example #9
0
 /// <inheritdoc />
 public async Task <IReadOnlyList <Repository> > GetRepositoriesForOrganizationAsync(string organizationName)
 {
     ArgumentCheck.StringIsNotNullOrWhiteSpace(organizationName, nameof(organizationName));
     return(await gitHubClient.Repository.GetAllForOrg(organizationName));
 }
 public void StringIsNotNullOrWhiteSpaceNegative()
 {
     // act, assert
     Assert.Throws <ArgumentException>(() => ArgumentCheck.StringIsNotNullOrWhiteSpace(null, nameof(ArgumentCheck)));
 }