Esempio n. 1
0
        public void Should_Throw_ArgumentOutOfRangeException_If_Invalid_BaseVersion_Provided()
        {
            var baseVersion = "-1.2.3";
            var version     = new Version();

            var versionPatcher = new VersionPatcher();
            var patchedVersion = versionPatcher.PatchBaseVersionWithVersion(baseVersion,
                                                                            version);
        }
Esempio n. 2
0
        public void Should_Throw_OverflowException_If_Invalid_BaseVersion_Provided()
        {
            var baseVersion = "1.9999999999.99";
            var version     = new Version();

            var versionPatcher = new VersionPatcher();
            var patchedVersion = versionPatcher.PatchBaseVersionWithVersion(baseVersion,
                                                                            version);
        }
Esempio n. 3
0
        public void Should_Return_Version_If_No_BaseVersion_Provided()
        {
            var baseVersion = default(string);
            var version     = new Version(1,
                                          0);

            var versionPatcher = new VersionPatcher();
            var patchedVersion = versionPatcher.PatchBaseVersionWithVersion(baseVersion,
                                                                            version);

            Assert.AreEqual(version,
                            patchedVersion);
        }
Esempio n. 4
0
        public void Should_Patch_Minor()
        {
            var baseVersion = "0.0.1";
            var version     = new Version(0,
                                          1,
                                          0);

            var versionPatcher = new VersionPatcher();
            var patchedVersion = versionPatcher.PatchBaseVersionWithVersion(baseVersion,
                                                                            version);

            var expectedPatchedVersion = new Version(0,
                                                     1,
                                                     0);

            Assert.AreEqual(expectedPatchedVersion,
                            patchedVersion);
        }