public ObservableGitDatabaseClient(IGitHubClient client)
 {
     Blob = new ObservableBlobClient(client);
     Tag = new ObservableTagsClient(client);
     Tree = new ObservableTreesClient(client);
     Commit = new ObservableCommitsClient(client);
     Reference = new ObservableReferencesClient(client);
 }
Exemplo n.º 2
0
 public ObservableGitDatabaseClient(IGitHubClient client)
 {
     Blob      = new ObservableBlobClient(client);
     Tag       = new ObservableTagsClient(client);
     Tree      = new ObservableTreesClient(client);
     Commit    = new ObservableCommitsClient(client);
     Reference = new ObservableReferencesClient(client);
 }
Exemplo n.º 3
0
            public void RequestsCorrectUrl()
            {
                var gitHubClient = Substitute.For <IGitHubClient>();
                var client       = new ObservableReferencesClient(gitHubClient);

                client.GetAll("owner", "repo");

                gitHubClient.Received().Git.Reference.GetAll("owner", "repo");
            }
Exemplo n.º 4
0
            public void RequestsCorrectUrlWithRepositoryId()
            {
                var gitHubClient = Substitute.For <IGitHubClient>();
                var client       = new ObservableReferencesClient(gitHubClient);

                client.GetAll(1);

                gitHubClient.Received().Git.Reference.GetAll(1);
            }
Exemplo n.º 5
0
            public void RequestsCorrectUrlWithRepositoryId()
            {
                var gitHubClient = Substitute.For <IGitHubClient>();
                var client       = new ObservableReferencesClient(gitHubClient);

                client.Delete(1, "heads/develop");

                gitHubClient.Received().Git.Reference.Delete(1, "heads/develop");
            }
Exemplo n.º 6
0
            public void EnsuresNonNullArguments()
            {
                var client = new ObservableReferencesClient(Substitute.For <IGitHubClient>());

                Assert.Throws <ArgumentNullException>(() => client.GetAll(null, "name"));
                Assert.Throws <ArgumentNullException>(() => client.GetAll("owner", null));

                Assert.Throws <ArgumentException>(() => client.GetAll("", "name"));
                Assert.Throws <ArgumentException>(() => client.GetAll("owner", ""));
            }
Exemplo n.º 7
0
            public void PostsToCorrectUrlWithRepositoryId()
            {
                var referenceUpdate = new ReferenceUpdate("sha");
                var gitHubClient    = Substitute.For <IGitHubClient>();
                var client          = new ObservableReferencesClient(gitHubClient);

                client.Update(1, "heads/develop", referenceUpdate);

                gitHubClient.Received().Git.Reference.Update(1, "heads/develop", referenceUpdate);
            }
Exemplo n.º 8
0
            public void PostsToCorrectUrl()
            {
                var newReference = new NewReference("heads/develop", "sha");
                var gitHubClient = Substitute.For <IGitHubClient>();
                var client       = new ObservableReferencesClient(gitHubClient);

                client.Create("owner", "repo", newReference);

                gitHubClient.Received().Git.Reference.Create("owner", "repo", newReference);
            }
Exemplo n.º 9
0
            public void EnsuresNonNullArguments()
            {
                var client = new ObservableReferencesClient(Substitute.For <IGitHubClient>());

                Assert.Throws <ArgumentNullException>(() => client.Create(null, "name", new NewReference("heads/develop", "sha")));
                Assert.Throws <ArgumentNullException>(() => client.Create("owner", null, new NewReference("heads/develop", "sha")));
                Assert.Throws <ArgumentNullException>(() => client.Create("owner", "name", null));

                Assert.Throws <ArgumentNullException>(() => client.Create(1, null));

                Assert.Throws <ArgumentException>(() => client.Create("", "name", new NewReference("heads/develop", "sha")));
                Assert.Throws <ArgumentException>(() => client.Create("owner", "", new NewReference("heads/develop", "sha")));
            }