public void TestWithInBetweenVersion() { var version = new SemanticVersion("1.5"); // from http://docs.nuget.org/docs/reference/versioning // 1.0 = 1.0 ≤ x Assert.True(VersionComparer.Matches(convert("1.0"), version)); // (,1.0] = x ≤ 1.0 Assert.False(VersionComparer.Matches(convert("(,1.0]"), version)); // (,1.0) = x < 1.0 Assert.False(VersionComparer.Matches(convert("(,1.0)"), version)); // [1.0] = x == 1.0 Assert.False(VersionComparer.Matches(convert("[1.0]"), version)); // (1.0,) = 1.0 < x Assert.True(VersionComparer.Matches(convert("(1.0,) "), version)); // (1.0,2.0) = 1.0 < x < 2.0 Assert.True(VersionComparer.Matches(convert("(1.0,2.0) "), version)); // [1.0,2.0] = 1.0 ≤ x ≤ 2.0 Assert.True(VersionComparer.Matches(convert("[1.0,2.0]"), version)); // empty = latest version. Assert.True(VersionComparer.Matches(null, version)); }