schambers/fluentmigrator — pull request #363 by daniellee (2013-01-18 22:18:00+00:00)
Title: Add validation to MigrationRunner

Since the very start, FluentMigrator has had validation for expressions but it has only been used for testing. I am guessing that it was meant to be used when running migrations but was forgotten. Any expression that implements the ICanBeValidated interface can define validation rules and almost all of the expressions have rules defined. It is a waste that they are not used while running migrations.

Right now if you run migrations and have made an error in an expression then it will throw an exception and show a stacktrace to the user. Not so easy to understand. This pull request will make MigrationRunner return a friendly error instead.

Example:
```c#
Create.Table("").WithColumn("Id").AsInt32().Identity();
```
Will return the error:
```
CreateTableExpression: The table's name cannot be null or an empty string.
```

There are a lot of commits in this pull request but most of them are tests. I wanted to be really sure I didn't break anything. I found two expressions that had incorrect validation rules defined and to be certain that everything would still work, I wrote unit tests for all expressions that were missing them and I wrote a bunch of integration tests for MigrationRunner (which should make it easier to find errors in other pull requests).

For anyone reviewing this, there are 3 code changes that are not tests. The second commit is the most important one - 84cf413 and the one I want some feedback on. The ApplyConventions method for an expression has to be applied before validation otherwise default names for Foreign Keys and Indexes etc. have not been set yet. So I moved the ApplyConventions method out of the main loop and execute it together with the CollectValidationErrors method. What do you think of this? Is that the best place to have the validation step?

The other changes are bug fixing of validation rule errors (88c3170 and 66e9c0e) and adding testhelpers and code for testing sequences.

I found a couple of other bugs while writing the integration tests but didn't fix them yet as it might have confused things. Will follow up them after this and fix them.