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));
 }
Exemple #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 }));
 }
Exemple #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));
 }
Exemple #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));
 }
Exemple #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));
 }
Exemple #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);
        }
Exemple #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));
        }
Exemple #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)));
 }