Changeset f75d4479e2dd…
Parent d1965f8809dd…
by
Changes to one file · Browse files at f75d4479e2dd Showing diff from parent d1965f8809dd Diff from another changeset...
|
@@ -1,60 +0,0 @@ - #region License
-//The contents of this file are subject to the Mozilla Public License
-//Version 1.1 (the "License"); you may not use this file except in
-//compliance with the License. You may obtain a copy of the License at
-//http://www.mozilla.org/MPL/
-//Software distributed under the License is distributed on an "AS IS"
-//basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the
-//License for the specific language governing rights and limitations
-//under the License.
-#endregion
-using System.Reflection;
-using NUnit.Framework;
-using Migrator.Providers;
-using Migrator.Providers.Tests;
-
-namespace Migrator.Tests
-{
- /// <summary>
- /// Extend this classe to test your migrations
- /// </summary>
- public abstract class MigrationsTestCase
- {
- private Migrator _migrator;
-
- protected abstract TransformationProvider TransformationProvider { get; }
- protected abstract string ConnectionString { get; }
- protected abstract Assembly MigrationAssembly { get; }
-
- [SetUp]
- public void SetUp()
- {
- TransformationProviderTestAdapter adapter =
- new TransformationProviderTestAdapter(TransformationProvider);
- _migrator = new Migrator(adapter, MigrationAssembly, true);
-
- Assert.IsTrue(_migrator.MigrationsTypes.Count > 0, "No migrations in assembly " + MigrationAssembly.Location);
-
- _migrator.MigrateTo(0);
- }
-
- [TearDown]
- public void TearDown()
- {
- _migrator.MigrateTo(0);
- }
-
- [Test]
- public void Up()
- {
- _migrator.MigrateToLastVersion();
- }
-
- [Test]
- public void Down()
- {
- _migrator.MigrateToLastVersion();
- _migrator.MigrateTo(0);
- }
- }
-}
|
Loading...