Ejemplo n.º 1
0
        public void EmptyRequestShouldBeRejectedAndPrintUsageInfo()
        {
            var    testSubject = new MigrateTo();
            Action call        = () => testSubject.Validate();

            call.Should().Throw <TerminateAndShowHelp>();
        }
Ejemplo n.º 2
0
        public void ValidRequestShouldBeAccepted()
        {
            var testSubject = new MigrateTo {
                Engine = "sqlite", ConnectionString = "valid", MigrationFolderName = "valid"
            };
            Action call = () => testSubject.Validate();

            call.Should().NotThrow();
        }
Ejemplo n.º 3
0
        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.");
        }