Esempio n. 1
0
        public void MixedVersionCompareNotEqual(string version1, string version2)
        {
            // Arrange
            var semVer1  = NuGetVersion.Parse(version1);
            var semVer2  = NuGetVersion.Parse(version2);
            var comparer = new GitMetadataComparer();

            // Act
            var result = comparer.Compare(semVer1, semVer2) == 0;

            // Assert
            Assert.False(result);
        }
Esempio n. 2
0
        public void NuGetVersionRangeWithGitCommitNotInRange(string verSpec, string ver)
        {
            // Arrange
            var versionInfo = VersionRange.Parse(verSpec);
            var version     = NuGetVersion.Parse(ver);
            var comparer    = new GitMetadataComparer();

            // Act
            var result = versionInfo.Satisfies(version, comparer);

            // Assert
            Assert.False(result);
        }
Esempio n. 3
0
        public void MixedVersionCompareNotEqual(string version1, string version2)
        {
            // Arrange
            var semVer1 = NuGetVersion.Parse(version1);
            var semVer2 = NuGetVersion.Parse(version2);
            var comparer = new GitMetadataComparer();

            // Act
            var result = comparer.Compare(semVer1, semVer2) == 0;

            // Assert
            Assert.False(result);
        }
Esempio n. 4
0
        public void NuGetVersionRangeWithGitCommitNotInRange(string verSpec, string ver)
        {
            // Arrange
            var versionInfo = VersionRange.Parse(verSpec);
            var version = NuGetVersion.Parse(ver);
            var comparer = new GitMetadataComparer();

            // Act
            var result = versionInfo.Satisfies(version, comparer);

            // Assert
            Assert.False(result);
        }
Esempio n. 5
0
        public void DictionaryWithGitCommit(string version1, string version2)
        {
            // Arrange
            var semVer1  = NuGetVersion.Parse(version1);
            var semVer2  = NuGetVersion.Parse(version2);
            var comparer = new GitMetadataComparer();
            var gitHash  = new HashSet <NuGetVersion>(comparer);

            // Act
            gitHash.Add(semVer1);

            // Assert
            Assert.True(gitHash.Contains(semVer2));
        }
Esempio n. 6
0
        public void DictionaryWithGitCommit(string version1, string version2)
        {
            // Arrange
            var semVer1 = NuGetVersion.Parse(version1);
            var semVer2 = NuGetVersion.Parse(version2);
            var comparer = new GitMetadataComparer();
            var gitHash = new HashSet<NuGetVersion>(comparer);

            // Act
            gitHash.Add(semVer1);

            // Assert
            Assert.True(gitHash.Contains(semVer2));
        }