public async Task EnsureNonNullOrEmptyArguments() { var client = new ObservableProjectsClient(Substitute.For <IGitHubClient>()); var newProject = new NewProject("someName"); await Assert.ThrowsAsync <ArgumentNullException>(() => client.CreateForOrganization(null, newProject).ToTask()); await Assert.ThrowsAsync <ArgumentException>(() => client.CreateForOrganization("", newProject).ToTask()); await Assert.ThrowsAsync <ArgumentNullException>(() => client.CreateForOrganization("org", null).ToTask()); }
public void PostsToCorrectURL() { var gitHubClient = Substitute.For <IGitHubClient>(); var client = new ObservableProjectsClient(gitHubClient); var newProject = new NewProject("someName"); client.CreateForOrganization("org", newProject); gitHubClient.Repository.Project.Received().CreateForOrganization("org", newProject); }