Ejemplo n.º 1
0
        public void TestIsMigrationAllowed()
        {
            var current = new Version {Major = "20120307", Minor = "001",};
            var file = new Version {Major = "20120308", Minor = "0001",};

            _guard.Suffix = null;

            Assert.IsTrue(_guard.IsMigrationAllowed(new FileInfo("./Fixtures/MySQL/Flat/20000101_001.sql"), current,
                                                    file));

            _guard.Suffix = ".sql";

            Assert.IsTrue(_guard.IsMigrationAllowed(new FileInfo("./Fixtures/MySQL/Flat/20000101_001.sql"), current,
                                                    file));
            Assert.IsFalse(_guard.IsMigrationAllowed(new FileInfo("./Fixtures/MySQL/Flat/20000101_002.ignored"), current,
                                                     file));
        }
Ejemplo n.º 2
0
 public void SetUp()
 {
     _strategy = new Flat();
     _version = new Version {Major = "20120307", Minor = "001",};
     _guard = new Guard();
 }
Ejemplo n.º 3
0
 /**
  * @param other_version compares this version against other_version
  * @return true if this is higher than other (means larger, newer)
  */
 public bool IsHigherThan(Version otherVersion)
 {
     return GetVersion() > otherVersion.GetVersion();
 }
Ejemplo n.º 4
0
 public void SetUp()
 {
     _strategy = new Flat();
     _version = new NeosIT.DB_Migrator.DBMigration.Version { Major = "20120101", Minor = "001", };
     _guard = new Guard();
 }