public void ParseRemoteUrl_returns_the_expected_GitHubProjectInfo(string url, string host, string owner, string repository) { // ARRANGE // ACT var projectInfo = GitHubUrlParser.ParseRemoteUrl(url); // ASSERT Assert.NotNull(projectInfo); Assert.Equal(host, projectInfo.Host); Assert.Equal(owner, projectInfo.Owner); Assert.Equal(repository, projectInfo.Repository); }
[InlineData("ftp://github.com/owner/repo.git")] // unsupported scheme public void TryParseRemoteUrl_returns_false_for_invalid_input(string url) { Assert.False(GitHubUrlParser.TryParseRemoteUrl(url, out var uri)); }
[InlineData("ftp://github.com/owner/repo.git")] // unsupported scheme public void ParseRemoteUrl_throws_ArgumentException_for_invalid_input(string url) { Assert.ThrowsAny <ArgumentException>(() => GitHubUrlParser.ParseRemoteUrl(url)); }