Repository: microsoft/PowerToys
File: src/modules/launcher/Plugins/Microsoft.Plugin.Uri.UnitTests/UriHelper/ExtendedUriParserTests.cs (C#)

Code before:
        [DataRow("microsoft-edge:google.com", true, null, "microsoft-edge:google.com")]
        [DataRow("microsoft-edge:google.com/", true, null, "microsoft-edge:google.com/")]
        [DataRow("microsoft-edge:google.com:80/", true, null, "microsoft-edge:google.com:80/")]
        [DataRow("microsoft-edge:google.com:443/", true, null, "microsoft-edge:google.com:443/")]
        [DataRow("microsoft-edge:google.com:1234/", true, null, "microsoft-edge:google.com:1234/")]
        [DataRow("microsoft-edge:http://google.com", true, null, "microsoft-edge:http://google.com")]
        [DataRow("microsoft-edge:http://google.com:80", true, null, "microsoft-edge:http://google.com:80")]
        [DataRow("microsoft-edge:http://google.com:443", true, null, "microsoft-edge:http://google.com:443")]
        [DataRow("microsoft-edge:http://google.com:1234", true, null, "microsoft-edge:http://google.com:1234")]
        [DataRow("microsoft-edge:https://google.com", true, null, "microsoft-edge:https://google.com")]
        [DataRow("microsoft-edge:https://google.com:80", true, null, "microsoft-edge:https://google.com:80")]
        [DataRow("microsoft-edge:https://google.com:443", true, null, "microsoft-edge:https://google.com:443")]
        [DataRow("microsoft-edge:https://google.com:1234", true, null, "microsoft-edge:https://google.com:1234")]
        [DataRow("ftp://user:password@localhost:8080", true, null, "ftp://user:password@localhost:8080/")]
        [DataRow("ftp://user:password@localhost:8080/", true, null, "ftp://user:password@localhost:8080/")]
        [DataRow("ftp://user:password@google.com", true, null, "ftp://user:password@google.com/")]
        [DataRow("ftp://user:password@google.com:2121", true, null, "ftp://user:password@google.com:2121/")]
        [DataRow("ftp://user:password@1.1.1.1", true, null, "ftp://user:password@1.1.1.1/")]
        [DataRow("ftp://user:password@1.1.1.1:2121", true, null, "ftp://user:password@1.1.1.1:2121/")]
        [DataRow("ftp://example.com", true, null, "ftp://example.com/")]
        [DataRow("ftp://example.com/test", true, null, "ftp://example.com/test")]
        [DataRow("ftp://example.com:123/test", true, null, "ftp://example.com:123/test")]
        [DataRow("ftp://example.com/126", true, null, "ftp://example.com/126")]
        [DataRow("^:", false, null, null)]

        public void TryParseCanParseHostName(string query, bool expectedSuccess, string expectedWebUri, string expectedSystemUri)
        {
            // Arrange
            var parser = new ExtendedUriParser();

            // Act
            var success = parser.TryParse(query, out var webUriResult, out var systemUriResult);

            // Assert
            Assert.AreEqual(expectedWebUri, webUriResult?.ToString());
            Assert.AreEqual(expectedSystemUri, systemUriResult?.ToString());
            Assert.AreEqual(expectedSuccess, success);
        }
    }
}


Review comment (suggestion):
```suggestion
        public void ParserReturnsExpectedResults(string query, bool expectedSuccess, string expectedWebUri, string expectedSystemUri)
```

Code after:
        [DataRow("microsoft-edge:google.com", true, null, "microsoft-edge:google.com")]
        [DataRow("microsoft-edge:google.com/", true, null, "microsoft-edge:google.com/")]
        [DataRow("microsoft-edge:google.com:80/", true, null, "microsoft-edge:google.com:80/")]
        [DataRow("microsoft-edge:google.com:443/", true, null, "microsoft-edge:google.com:443/")]
        [DataRow("microsoft-edge:google.com:1234/", true, null, "microsoft-edge:google.com:1234/")]
        [DataRow("microsoft-edge:http://google.com", true, null, "microsoft-edge:http://google.com")]
        [DataRow("microsoft-edge:http://google.com:80", true, null, "microsoft-edge:http://google.com:80")]
        [DataRow("microsoft-edge:http://google.com:443", true, null, "microsoft-edge:http://google.com:443")]
        [DataRow("microsoft-edge:http://google.com:1234", true, null, "microsoft-edge:http://google.com:1234")]
        [DataRow("microsoft-edge:https://google.com", true, null, "microsoft-edge:https://google.com")]
        [DataRow("microsoft-edge:https://google.com:80", true, null, "microsoft-edge:https://google.com:80")]
        [DataRow("microsoft-edge:https://google.com:443", true, null, "microsoft-edge:https://google.com:443")]
        [DataRow("microsoft-edge:https://google.com:1234", true, null, "microsoft-edge:https://google.com:1234")]
        [DataRow("ftp://user:password@localhost:8080", true, null, "ftp://user:password@localhost:8080/")]
        [DataRow("ftp://user:password@localhost:8080/", true, null, "ftp://user:password@localhost:8080/")]
        [DataRow("ftp://user:password@google.com", true, null, "ftp://user:password@google.com/")]
        [DataRow("ftp://user:password@google.com:2121", true, null, "ftp://user:password@google.com:2121/")]
        [DataRow("ftp://user:password@1.1.1.1", true, null, "ftp://user:password@1.1.1.1/")]
        [DataRow("ftp://user:password@1.1.1.1:2121", true, null, "ftp://user:password@1.1.1.1:2121/")]
        [DataRow("ftp://example.com", true, null, "ftp://example.com/")]
        [DataRow("ftp://example.com/test", true, null, "ftp://example.com/test")]
        [DataRow("ftp://example.com:123/test", true, null, "ftp://example.com:123/test")]
        [DataRow("ftp://example.com/126", true, null, "ftp://example.com/126")]
        [DataRow("^:", false, null, null)]

        public void ParserReturnsExpectedResults(string query, bool expectedSuccess, string expectedWebUri, string expectedSystemUri)
        {
            // Arrange
            var parser = new ExtendedUriParser();

            // Act
            var success = parser.TryParse(query, out var webUriResult, out var systemUriResult);

            // Assert
            Assert.AreEqual(expectedWebUri, webUriResult?.ToString());
            Assert.AreEqual(expectedSystemUri, systemUriResult?.ToString());
            Assert.AreEqual(expectedSuccess, success);
        }
    }
}