Пример #1
0
            public void EnsuresArgumentsNotNull()
            {
                var gitHubClient = Substitute.For <IGitHubClient>();
                var client       = new ObservableMilestonesClient(gitHubClient);

                Assert.Throws <ArgumentNullException>(() => client.Update(null, "name", 42, new MilestoneUpdate()));
                Assert.Throws <ArgumentException>(() => client.Update("", "name", 42, new MilestoneUpdate()));
                Assert.Throws <ArgumentNullException>(() => client.Update("owner", null, 42, new MilestoneUpdate()));
                Assert.Throws <ArgumentException>(() => client.Update("owner", "", 42, new MilestoneUpdate()));
                Assert.Throws <ArgumentNullException>(() => client.Update("owner", "name", 42, null));
            }
            public void UpdatesClientIssueMilestoneWithRepositoryId()
            {
                var milestoneUpdate = new MilestoneUpdate();
                var gitHubClient    = Substitute.For <IGitHubClient>();
                var client          = new ObservableMilestonesClient(gitHubClient);

                client.Update(1, 42, milestoneUpdate);

                gitHubClient.Issue.Milestone.Received().Update(1, 42, milestoneUpdate);
            }