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 RequestsCorrectUrl()
            {
                var gitHubClient     = Substitute.For <IGitHubClient>();
                var statisticsClient = new ObservableStatisticsClient(gitHubClient);

                statisticsClient.GetCodeFrequency("owner", "name");

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

                statisticsClient.GetCommitActivity(1);

                gitHubClient.Repository.Statistics.Received().GetCommitActivity(1);
            }
            public void EnsureNonNullArguments()
            {
                var client = new ObservableStatisticsClient(Substitute.For <IGitHubClient>());

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

                Assert.Throws <ArgumentException>(() => client.GetCommitActivity("", "name"));
                Assert.Throws <ArgumentException>(() => client.GetCommitActivity("owner", ""));
            }
 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));
 }