Permalink
Browse files

Integration tests for SqlServer2012

These are exactly the same as for Sql Server 2008 and 2005. Might add
integration tests for Create Sequence if it doesn't cause problems for
other committers.
  • Loading branch information...
1 parent e131b87 commit 0bc99c1de53c71bd30072afe25fd940a6582d5dd @daniellee daniellee committed Sep 30, 2012
@@ -55,6 +55,7 @@ public void ExecuteWithSupportedProcessors(Action<IMigrationProcessor> test, Boo
{
ExecuteWithSqlServer2005(test, tryRollback);
ExecuteWithSqlServer2008(test, tryRollback);
+ ExecuteWithSqlServer2012(test, tryRollback);
}
if (exceptProcessors.Count(t => typeof(SqliteProcessor).IsAssignableFrom(t)) == 0)
@@ -70,6 +71,21 @@ public void ExecuteWithSupportedProcessors(Action<IMigrationProcessor> test, Boo
ExecuteWithFirebird(test, IntegrationTestOptions.Firebird);
}
+ protected static void ExecuteWithSqlServer2012(Action<IMigrationProcessor> test, bool tryRollback)
+ {
+
+ var serverOptions = IntegrationTestOptions.SqlServer2012;
+
+ if (!serverOptions.IsEnabled)
+ return;
+
+ var announcer = new TextWriterAnnouncer(System.Console.Out);
+ announcer.Heading("Testing Migration against MS SQL Server 2012");
+ var generator = new SqlServer2012Generator();
+
+ ExecuteWithSqlServer(serverOptions, announcer, generator, test, tryRollback);
+ }
+
protected static void ExecuteWithSqlServer2008(Action<IMigrationProcessor> test, bool tryRollback)
{
@@ -33,6 +33,7 @@ public void CanCreateAndDeleteTableUsingThePerformDBOperationExpressions()
};
ExecuteWithSqlServer2008(processor => processor.Process(expression), true);
+ ExecuteWithSqlServer2012(processor => processor.Process(expression), true);
}
}
}
@@ -38,8 +38,8 @@ public class SqlServerProcessorTests
[SetUp]
public void SetUp()
{
- Connection = new SqlConnection(IntegrationTestOptions.SqlServer2008.ConnectionString);
- Processor = new SqlServerProcessor(Connection, new SqlServer2008Generator(), new TextWriterAnnouncer(System.Console.Out), new ProcessorOptions(), new SqlServerDbFactory());
+ Connection = new SqlConnection(IntegrationTestOptions.SqlServer2012.ConnectionString);
+ Processor = new SqlServerProcessor(Connection, new SqlServer2012Generator(), new TextWriterAnnouncer(System.Console.Out), new ProcessorOptions(), new SqlServerDbFactory());
}
[TearDown]
@@ -119,11 +119,11 @@ public void CallingProcessWithPerformDBOperationExpressionWhenInPreviewOnlyModeW
{
var output = new StringWriter();
- var connection = new SqlConnection(IntegrationTestOptions.SqlServer2008.ConnectionString);
+ var connection = new SqlConnection(IntegrationTestOptions.SqlServer2012.ConnectionString);
var processor = new SqlServerProcessor(
connection,
- new SqlServer2008Generator(),
+ new SqlServer2012Generator(),
new TextWriterAnnouncer(output),
new ProcessorOptions { PreviewOnly = true },
new SqlServerDbFactory());
@@ -16,6 +16,12 @@ public static class IntegrationTestOptions
IsEnabled = false
};
+ public static DatabaseServerOptions SqlServer2012 = new DatabaseServerOptions
+ {
+ ConnectionString = @"server=.\SQLEXPRESS;uid=test;pwd=test;Trusted_Connection=yes;database=FluentMigrator",
+ IsEnabled = false
+ };
+
public static DatabaseServerOptions SqlLite = new DatabaseServerOptions
{
ConnectionString = @"Data Source=:memory:;Version=3;New=True;",

0 comments on commit 0bc99c1

Please sign in to comment.