public ObservableGitDatabaseClient(IGitHubClient client)
 {
     Blob = new ObservableBlobClient(client);
     Tag = new ObservableTagsClient(client);
     Tree = new ObservableTreesClient(client);
     Commit = new ObservableCommitsClient(client);
     Reference = new ObservableReferencesClient(client);
 }
Ejemplo 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);
 }
Ejemplo n.º 3
0
            public void GetsFromClientIssueComment()
            {
                var gitHubClient = Substitute.For <IGitHubClient>();
                var client       = new ObservableBlobClient(gitHubClient);

                client.Get("fake", "repo", "123456ABCD");

                gitHubClient.GitDatabase.Blob.Received().Get("fake", "repo", "123456ABCD");
            }
Ejemplo n.º 4
0
            public async Task RequestsCorrectUrlWithRepositoryId()
            {
                var gitHubClient = Substitute.For <IGitHubClient>();
                var client       = new ObservableBlobClient(gitHubClient);

                client.Get(1, "123456ABCD");

                gitHubClient.Git.Blob.Received().Get(1, "123456ABCD");
            }
Ejemplo n.º 5
0
            public void RequestsCorrectUrl()
            {
                var gitHubClient = Substitute.For <IGitHubClient>();
                var client       = new ObservableBlobClient(gitHubClient);

                client.Get("fake", "repo", "123456ABCD");

                gitHubClient.Git.Blob.Received().Get("fake", "repo", "123456ABCD");
            }
Ejemplo n.º 6
0
            public void PostsToCorrectUrl()
            {
                var newBlob      = new NewBlob();
                var gitHubClient = Substitute.For <IGitHubClient>();
                var client       = new ObservableBlobClient(gitHubClient);

                client.Create("fake", "repo", newBlob);

                gitHubClient.GitDatabase.Blob.Received().Create("fake", "repo", newBlob);
            }
Ejemplo n.º 7
0
            public void PostsToCorrectUrlWithRepositoryId()
            {
                var gitHubClient = Substitute.For <IGitHubClient>();
                var client       = new ObservableBlobClient(gitHubClient);

                var newBlob = new NewBlob();

                client.Create(1, newBlob);

                gitHubClient.Git.Blob.Received().Create(1, newBlob);
            }
Ejemplo n.º 8
0
            public async Task EnsuresArgumentsNotNull()
            {
                var gitHubClient = Substitute.For <IGitHubClient>();
                var client       = new ObservableBlobClient(gitHubClient);

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

                Assert.Throws <ArgumentException>(() => client.Create("", "name", new NewBlob()));
                Assert.Throws <ArgumentException>(() => client.Create("owner", "", new NewBlob()));
            }
Ejemplo n.º 9
0
            public async Task EnsuresArguments()
            {
                var client = new ObservableBlobClient(Substitute.For <IGitHubClient>());

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

                Assert.Throws <ArgumentException>(() => client.Get("", "name", "123456ABCD"));
                Assert.Throws <ArgumentException>(() => client.Get("owner", "", "123456ABCD"));
                Assert.Throws <ArgumentException>(() => client.Get("owner", "name", ""));
            }