Ejemplo n.º 1
0
        public void PreReleaseCanDecrement()
        {
            SemanticVersion   v1  = new SemanticVersion(1, 0, 0, "alpha.1");
            SemanticVersion   v2  = new SemanticVersion(1, 3, 4, "alpha.2.0");
            SemanticVersion   v3  = new SemanticVersion(0, 0, 0, "beta");
            SemanticVersion   v4  = new SemanticVersion(0, 0, 0, "beta.x.0");
            PreReleaseVersion v11 = --(v1.PreRelease);
            PreReleaseVersion v21 = --(v2.PreRelease);

            Assert.Equal(v11.Count, 1);
            Assert.Equal(v11.ToString(), "alpha");
            Assert.Equal(v21.ToString(), "alpha1");
            Assert.Equal((--v3).ToString(), "0.0.0");
            Assert.Equal((--v4).ToString(), "0.0.0.beta");
        }
Ejemplo n.º 2
0
        public void PreReleaseCanIncrement()
        {
            SemanticVersion   v1       = new SemanticVersion(1, 0, 0, "alpha.1");
            SemanticVersion   v2       = new SemanticVersion(1, 3, 4, "alpha.2.0");
            SemanticVersion   v3       = new SemanticVersion(0, 0, 0, "beta");
            SemanticVersion   v4       = new SemanticVersion(0, 0, 0, "beta.x.0");
            SemanticVersion   bx860new = new SemanticVersion(0, 0, 0, "beta.x86.0.new");
            PreReleaseVersion v11      = ++(v1.PreRelease);
            PreReleaseVersion v21      = ++(v2.PreRelease);

            Assert.Equal(v11.ToString(), "alpha2");
            Assert.Equal(v11[1], "2");
            Assert.Equal(v21[1], "3");
            Assert.Equal(v21.ToString(), "alpha3");
            ++(v3.PreRelease);
            Assert.Equal(v3.PreRelease.Count, 2);
            Assert.Equal(v3.PreRelease[1], "1");
            ++(v4.PreRelease);
            Assert.Equal(v4.PreRelease[2], "1");
            Assert.Equal((++bx860new).PreRelease.ToString(), "beta.x86.0.new.1");
        }