コード例 #1
0
            public void RequestsCorrectUrlWithRepositoryId()
            {
                var gitHubClient = Substitute.For<IGitHubClient>();
                var client = new ObservableReferencesClient(gitHubClient);

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

                gitHubClient.Received().Git.Reference.Get(1, "heads/develop");
            }
コード例 #2
0
            public void EnsuresNonNullArguments()
            {
                var client = new ObservableReferencesClient(Substitute.For<IGitHubClient>());

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

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

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

                Assert.Throws<ArgumentException>(() => client.Get(1, ""));
            }