public void TestParseNameVersionPairs(string expectedName, string expectedVersion, string[] input) { var versionParser = new VersionParser(); var result = versionParser.ParseNameVersionPairs(input); Assert.AreEqual(1, result.Length); var(actualName, actualVersion) = result[0]; Assert.AreEqual(expectedName, actualName); Assert.AreEqual(expectedVersion, actualVersion); }
public void TestParseNameVersionMultPackages() { var versionParser = new VersionParser(); var result = versionParser.ParseNameVersionPairs(new[] { "foo", "vendor/bar" }); Assert.AreEqual(2, result.Length); var(actualName, actualVersion) = result[0]; Assert.AreEqual("foo", actualName); Assert.AreEqual(null, actualVersion); (actualName, actualVersion) = result[1]; Assert.AreEqual("vendor/bar", actualName); Assert.AreEqual(null, actualVersion); }