public void EmptyRequestShouldBeRejectedAndPrintUsageInfo() { var testSubject = new MigrateTo(); Action call = () => testSubject.Validate(); call.Should().Throw <TerminateAndShowHelp>(); }
public void ValidRequestShouldBeAccepted() { var testSubject = new MigrateTo { Engine = "sqlite", ConnectionString = "valid", MigrationFolderName = "valid" }; Action call = () => testSubject.Validate(); call.Should().NotThrow(); }
public void InvalidEngineShouldBeRejectedWithUsefulErrorMessage() { var testSubject = new MigrateTo { Engine = "not a valid engine", ConnectionString = "valid", MigrationFolderName = "valid" }; Action call = () => testSubject.Validate(); call.Should().Throw <TerminateProgramWithMessageException>() .WithMessage( $"I don't know the database engine '{testSubject.Engine}'. I only understand how to communicate with {DbEngine.KnownEngineNames}. Please extend me if you want to use that engine."); }