コード例 #1
0
        public void BadMigrationFileNameShouldThrowFriendlyMessage()
        {
            Action testSubject = () => MigrationFile.FileNameVersion("3asfasdf.migration.sql");

            testSubject.Should().Throw <TerminateProgramWithMessageException>()
            .WithMessage(
                @"Invalid migration file name found.

I don't know how to extract the version number from the file name
'3asfasdf.migration.sql'.

Migration files are required to be named like 'X_name.migration.sql', where
X is the version number and name can be anything you want.")
            .And.ErrorLevel.Should().Be(1);
        }
コード例 #2
0
 public void ShouldKnowHowToGetVersionNumberFromFileName()
 {
     MigrationFile.FileNameVersion("3_asfasdf.migration.sql").Should().Be(3);
 }