Ejemplo n.º 1
0
        public void FolderBasedMigrationLoaderShouldNotFindUndefinedMigrations()
        {
            var testSubject = new MigrationRepoDirectory(DirectoryWithTwoMigrations());
            var result      = testSubject.LoadMigrationIfPresent(7);

            result.Should().BeNull();
        }
 public void FolderBasedMigrationLoaderShouldIgnoreNonMigrationFiles()
 {
     var repo = DirectoryWithTwoMigrations();
     repo.AddFile("readme.txt", "content is unimportant");
     var testSubject = new MigrationRepoDirectory(repo);
     testSubject.MaxMigrationVersionFound.Should().Be(2);
 }
 public void FolderBasedMigrationLoaderShouldFindMigrationsThatAreDefinedInTheFolder()
 {
     var testSubject = new MigrationRepoDirectory(DirectoryWithTwoMigrations());
     var result = testSubject.LoadMigrationIfPresent(1);
     result.Should().NotBeNull();
     result.Version.Should().Be(1);
     result.Apply.Should().Be("create table Foo;");
 }
Ejemplo n.º 4
0
        public void FolderBasedMigrationLoaderShouldIgnoreNonMigrationFiles()
        {
            var repo = DirectoryWithTwoMigrations();

            repo.AddFile("readme.txt", "content is unimportant");
            var testSubject = new MigrationRepoDirectory(repo);

            testSubject.MaxMigrationVersionFound.Should().Be(2);
        }
Ejemplo n.º 5
0
        public void FolderBasedMigrationLoaderShouldFindMigrationsThatAreDefinedInTheFolder()
        {
            var testSubject = new MigrationRepoDirectory(DirectoryWithTwoMigrations());
            var result      = testSubject.LoadMigrationIfPresent(1);

            result.Should().NotBeNull();
            result.Version.Should().Be(1);
            result.Apply.Should().Be("create table Foo;");
        }
Ejemplo n.º 6
0
        public void FolderBasedMigrationLoaderShouldFindNothingWithAnEmptyDirectory()
        {
            var testSubject = new MigrationRepoDirectory(new DirectoryInMemory());

            testSubject.MaxMigrationVersionFound.Should().Be(-1);
        }
Ejemplo n.º 7
0
        public void FolderBasedMigrationLoaderShouldFindAllMigrationsInOneFolder()
        {
            var testSubject = new MigrationRepoDirectory(DirectoryWithTwoMigrations());

            testSubject.MaxMigrationVersionFound.Should().Be(2);
        }
 public void FolderBasedMigrationLoaderShouldNotFindUndefinedMigrations()
 {
     var testSubject = new MigrationRepoDirectory(DirectoryWithTwoMigrations());
     var result = testSubject.LoadMigrationIfPresent(7);
     result.Should().BeNull();
 }
 public void FolderBasedMigrationLoaderShouldFindNothingWithAnEmptyDirectory()
 {
     var testSubject = new MigrationRepoDirectory(new DirectoryInMemory());
     testSubject.MaxMigrationVersionFound.Should().Be(-1);
 }
 public void FolderBasedMigrationLoaderShouldFindAllMigrationsInOneFolder()
 {
     var testSubject = new MigrationRepoDirectory(DirectoryWithTwoMigrations());
     testSubject.MaxMigrationVersionFound.Should().Be(2);
 }