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

                client.Get(1, 42);

                gitHubClient.Received().Issue.Events.Get(1, 42);
            }
コード例 #2
0
            public async Task EnsuresNonNullArguments()
            {
                var client = new ObservableIssuesEventsClient(Substitute.For<IGitHubClient>());

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

                Assert.Throws<ArgumentException>(() => client.Get("", "name", 1));
                Assert.Throws<ArgumentException>(() => client.Get("owner", "", 1));
            }
コード例 #3
0
            public void RequestsCorrectUrl()
            {
                var gitHubClient = Substitute.For<IGitHubClient>();
                var client = new ObservableIssuesEventsClient(gitHubClient);

                client.Get("fake", "repo", 42);

                gitHubClient.Received().Issue.Events.Get("fake", "repo", 42);
            }