Exemple #1
0
 public void TestBasicMajorMinorPatchVersion()
 {
     SemverVersionTestHelper.AssertVersionsEqual(
         1,
         2,
         3,
         null,
         null,
         SemverVersion.Parse("1.2.3"));
 }
Exemple #2
0
 public void TestPreReleaseHyphenatedIdentifier()
 {
     SemverVersionTestHelper.AssertVersionsEqual(
         1,
         2,
         3,
         "alpha-2.1",
         null,
         SemverVersion.Parse("1.2.3-alpha-2.1"));
 }
Exemple #3
0
 public void TestBuildMetadataOnly()
 {
     SemverVersionTestHelper.AssertVersionsEqual(
         1,
         0,
         0,
         null,
         "20130313144700",
         SemverVersion.Parse("1.0.0+20130313144700"));
 }
        public void ReadNameAndVersion()
        {
            var pkgJson = LoadFrom(PkgSimple);

            dynamic json = JsonConvert.DeserializeObject(PkgSimple);

            Assert.AreEqual(json.name.ToString(), pkgJson.Name, "Mismatched package names.");
            Assert.AreEqual(json.version.ToString(), pkgJson.Version.ToString(), "Mismatched version strings.");

            SemverVersionTestHelper.AssertVersionsEqual(0, 1, 0, null, null, pkgJson.Version);
        }
Exemple #5
0
 public void TestPreReleaseAndBuildMetadata()
 {
     // 1.0.0-alpha+001, 1.0.0+20130313144700, 1.0.0-beta+exp.sha.5114f85
     SemverVersionTestHelper.AssertVersionsEqual(1, 0, 0, "alpha", "001", SemverVersion.Parse("1.0.0-alpha+001"));
     SemverVersionTestHelper.AssertVersionsEqual(
         1,
         0,
         0,
         "beta",
         "exp.sha.5114f85",
         SemverVersion.Parse("1.0.0-beta+exp.sha.5114f85"));
 }
Exemple #6
0
 public void TestPreReleaseHyphenatedIdentifierWithoutVersion()
 {
     // This version code is crazy, and for that reason it fail when
     // regional settings is set to Turkish.
     SemverVersionTestHelper.AssertVersionsEqual(
         0,
         1,
         4,
         "DEPRECATED-USE-cfenv-INSTEAD",
         null,
         SemverVersion.Parse("0.1.4-DEPRECATED-USE-cfenv-INSTEAD"));
 }
Exemple #7
0
 public void TestNumericPreRelease()
 {
     SemverVersionTestHelper.AssertVersionsEqual(1, 2, 3, "4.5.6", null, SemverVersion.Parse("1.2.3-4.5.6"));
 }
Exemple #8
0
 public void TestAlphaPreRelease()
 {
     SemverVersionTestHelper.AssertVersionsEqual(1, 2, 3, "alpha", null, SemverVersion.Parse("1.2.3-alpha"));
 }