Beispiel #1
0
        public void VersionStepToString()
        {
            MigratorVersionStep v;

            v = new MigratorVersionStep(1, 3, 7, 6);
            Assert.True(v.ToString().Equals("1.3.7 Step 6"));
        }
Beispiel #2
0
        public void VersionStepEqualToVersion()
        {
            MigratorVersionStep v1;
            PackageVersion      v2;

            v1 = new MigratorVersionStep(1, 3, 6, 0);
            v2 = new PackageVersion("1.3.6");
            Assert.True((v1.CompareTo(v2) == 0));
        }
Beispiel #3
0
        public void VersionStepsAreNotEqual()
        {
            MigratorVersionStep v;

            v = new MigratorVersionStep(1, 3, 7, 6);
            Assert.True((v.CompareTo(new MigratorVersionStep(2, 7, 1, 9)) != 0));
            Assert.True((v.CompareTo(new MigratorVersionStep(1, 7, 1, 9)) != 0));
            Assert.True((v.CompareTo(new MigratorVersionStep(1, 3, 8, 9)) != 0));
            Assert.True((v.CompareTo(new MigratorVersionStep(1, 3, 7, 9)) != 0));
        }
Beispiel #4
0
        public void VersionStepGreaterThanVersion()
        {
            MigratorVersionStep v1;
            PackageVersion      v2;

            v1 = new MigratorVersionStep(1, 3, 7, 6);
            v2 = new PackageVersion("1.3.7");
            Assert.True((v1.CompareTo(v2) == 1));

            v2 = new PackageVersion("1.3.6");
            Assert.True((v1.CompareTo(v2) == 1));
        }
Beispiel #5
0
        public void VersionStepsAreEqual()
        {
            MigratorVersionStep v1, v2;

            v1 = new MigratorVersionStep(1, 3, 7, 6);
            v2 = new MigratorVersionStep(1, 3, 7, 6);

            Assert.AreEqual(v1.Major, 1);
            Assert.AreEqual(v1.Minor, 3);
            Assert.AreEqual(v1.Revision, 7);
            Assert.AreEqual(v1.Step, 6);
            Assert.True((v1.CompareTo(v2) == 0));
        }
Beispiel #6
0
        public void CompareToLessThanMigratorStepTest()
        {
            MigratorVersionStep v2;
            PackageVersion      v1;
            int result;


            //
            // Prepare the test.
            //
            v1 = new PackageVersion("1.3.7");
            v2 = new MigratorVersionStep(1, 3, 7, 6);

            //
            // Run the test.
            //
            result = v1.CompareTo(v2);

            //
            // Verify the test.
            //
            Assert.AreEqual(-1, result);
        }