public void EnsureNonNullArguments()
            {
                var client = new ObservableStatisticsClient(Substitute.For<IGitHubClient>());

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

                Assert.Throws<ArgumentException>(() => client.GetContributors("", "name"));
                Assert.Throws<ArgumentException>(() => client.GetContributors("owner", ""));
            }
            public void GetsFromClientIssueMilestone()
            {
                var gitHubClient = Substitute.For<IGitHubClient>();
                var statisticsClient = new ObservableStatisticsClient(gitHubClient);

                statisticsClient.GetContributors("username", "repositoryName");

                gitHubClient.Repository.Statistics.Received().GetContributors("username", "repositoryName");
            }
            public void RequestsCorrectUrlWithRepositoryId()
            {
                var gitHubClient = Substitute.For<IGitHubClient>();
                var statisticsClient = new ObservableStatisticsClient(gitHubClient);

                statisticsClient.GetContributors(1);

                gitHubClient.Repository.Statistics.Received().GetContributors(1);
            }
 public async Task ThrowsIfGivenNullOwnerName()
 {
     var statisticsClient = new ObservableStatisticsClient(Substitute.For<IGitHubClient>());
     await Assert.ThrowsAsync<ArgumentNullException>(() => statisticsClient.GetContributors(null, "repositoryName").ToTask());
 }
 public async Task ThrowsIfGivenNullRepositoryName()
 {   
     var statisticsClient = new ObservableStatisticsClient(Substitute.For<IGitHubClient>());
     await AssertEx.Throws<ArgumentNullException>(async () => await statisticsClient.GetContributors("owner", null));
 }