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

                client.Get(1, "reference");

                gitHubClient.Received().Git.Tag.Get(1, "reference");
            }
예제 #4
0
            public void EnsuresNonNullArguments()
            {
                var client = new ObservableTagsClient(Substitute.For <IGitHubClient>());

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

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

                Assert.Throws <ArgumentException>(() => client.Create("", "name", new NewTag()));
                Assert.Throws <ArgumentException>(() => client.Create("owner", "", new NewTag()));
            }
예제 #5
0
            public void PostsToTheCorrectUrlWithRepositoryId()
            {
                var gitHubClient = Substitute.For <IGitHubClient>();
                var client       = new ObservableTagsClient(gitHubClient);

                var newTag = new NewTag {
                    Type = TaggedType.Tree
                };

                client.Create(1, newTag);

                gitHubClient.Received().Git.Tag.Create(1, newTag);
            }
예제 #6
0
            public void EnsuresNonNullArguments()
            {
                var client = new ObservableTagsClient(Substitute.For <IGitHubClient>());

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

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

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

                Assert.Throws <ArgumentException>(() => client.Get(1, ""));
            }
 public ObservableGitDatabaseClient(IGitHubClient client)
 {
     Tag = new ObservableTagsClient(client);
 }
 public ObservableGitDatabaseClient(IGitHubClient client)
 {
     Tag = new ObservableTagsClient(client);
     Commit = new ObservableCommitsClient(client);
 }