public void EnsuresNonEmptyArguments() { var gitHubClient = Substitute.For <IGitHubClient>(); var client = new ObservableRepositoriesClient(gitHubClient); var transfer = new RepositoryTransfer("newOwner"); Assert.Throws <ArgumentException>( () => client.Transfer("", "name", transfer)); Assert.Throws <ArgumentException>( () => client.Transfer("owner", "", transfer)); }
public void CallsIntoClientById() { var gitHubClient = Substitute.For <IGitHubClient>(); var client = new ObservableRepositoriesClient(gitHubClient); var transfer = new RepositoryTransfer("newOwner"); client.Transfer(1, transfer); gitHubClient.Repository.Received().Transfer(1, transfer); }
public void EnsuresNonNullArgumentsById() { var gitHubClient = Substitute.For <IGitHubClient>(); var client = new ObservableRepositoriesClient(gitHubClient); var transfer = new RepositoryTransfer("newOwner"); var repositoryId = 1; Assert.Throws <ArgumentNullException>( () => client.Transfer(repositoryId, null)); }