Exemplo n.º 1
0
        public void Can_increment_numbers()
        {
            var ver = new SemanticVersion(0, 0, 0);

            /// source: https://semver.org/#spec-item-6
            (ver = ver.NextPatch()).ShouldBe(new SemanticVersion(0, 0, 1));
            (ver = ver.NextPatch(5)).ShouldBe(new SemanticVersion(0, 0, 5));

            /// source: https://semver.org/#spec-item-7
            (ver = ver.NextMinor()).ShouldBe(new SemanticVersion(0, 1, 0));
            (ver = ver.NextMinor(5)).ShouldBe(new SemanticVersion(0, 5, 0));
            (ver = ver.NextPatch()).ShouldBe(new SemanticVersion(0, 5, 1));

            /// source: https://semver.org/#spec-item-8
            (ver = ver.NextMajor()).ShouldBe(new SemanticVersion(1, 0, 0));
            (ver = ver.NextMajor(5)).ShouldBe(new SemanticVersion(5, 0, 0));
            (ver = ver.NextMinor()).ShouldBe(new SemanticVersion(5, 1, 0));
            (ver = ver.NextPatch()).ShouldBe(new SemanticVersion(5, 1, 1));
        }