コード例 #1
0
ファイル: LooseMode.cs プロジェクト: aleksandert/semver.net
        public void Versions(string looseVersionString, string strictVersionString)
        {
            var looseVersion = new Version(looseVersionString, true);

            // Loose version is equivalent to strict version
            var strictVersion = new Version(strictVersionString);
            Assert.Equal(strictVersion.Clean(), looseVersion.Clean());
            Assert.Equal(strictVersion, looseVersion);

            // Loose version should be invalid in strict mode
            Assert.Throws<ArgumentException>(() => new Version(looseVersionString));
        }