public void EnsuresArgumentsNotNull() { var gitHubClient = Substitute.For <IGitHubClient>(); var client = new ObservableMilestonesClient(gitHubClient); Assert.Throws <ArgumentNullException>(() => client.Create(null, "name", new NewMilestone("title"))); Assert.Throws <ArgumentException>(() => client.Create("", "name", new NewMilestone("x"))); Assert.Throws <ArgumentNullException>(() => client.Create("owner", null, new NewMilestone("x"))); Assert.Throws <ArgumentException>(() => client.Create("owner", "", new NewMilestone("x"))); Assert.Throws <ArgumentNullException>(() => client.Create("owner", "name", null)); }
public void CreatesFromClientIssueMilestoneWithRepositoryId() { var newMilestone = new NewMilestone("some title"); var gitHubClient = Substitute.For <IGitHubClient>(); var client = new ObservableMilestonesClient(gitHubClient); client.Create(1, newMilestone); gitHubClient.Issue.Milestone.Received().Create(1, newMilestone); }