Example #1
0
        public override bool Equals(object obj)
        {
            MigrationStep step = obj as MigrationStep;

            if (step == null)
            {
                return(false);
            }
            return(this.MigrationReference.Equals(step.MigrationReference) && this.Reverting == step.Reverting);
        }
Example #2
0
 public void Apply_WhenReverting_GoesDown()
 {
     _step1 = new MigrationStep(_reference1, true);
     _step1.DatabaseMigration = _mocks.StrictMock <IDatabaseMigration>();
     using (_mocks.Record())
     {
         _step1.DatabaseMigration.Down();
     }
     _step1.Apply();
     _mocks.VerifyAll();
 }
 public void Apply_WhenReverting_GoesDown()
 {
     _step1 = new MigrationStep(_reference1, true);
       _step1.DatabaseMigration = _mocks.StrictMock<IDatabaseMigration>();
       using (_mocks.Record())
       {
     _step1.DatabaseMigration.Down();
       }
       _step1.Apply();
       _mocks.VerifyAll();
 }
Example #4
0
 public void VersionAfterApplication_WhenReverting_IsPreviousVersion()
 {
     _step1 = new MigrationStep(_reference1, true);
     Assert.AreEqual(0, _step1.VersionAfterApplying);
 }
Example #5
0
 public void VersionAfterApplication_WhenNotReverting_IsOurVersion()
 {
     _step1 = new MigrationStep(_reference1, false);
     Assert.AreEqual(1, _step1.VersionAfterApplying);
 }
Example #6
0
 public void GetHashCode_Always_SameAsReferenceThatIsGoodEnough()
 {
     _step1 = new MigrationStep(_reference1, true);
     Assert.AreEqual(_reference1.GetHashCode(), _step1.GetHashCode());
 }
Example #7
0
 public void Equals_DifferentType_IsFalse()
 {
     _step1 = new MigrationStep(_reference1, true);
     Assert.IsFalse(_step1.Equals("HI"));
 }
Example #8
0
 public void Equals_DifferentReference_SameReverting_IsFalse()
 {
     _step1 = new MigrationStep(_reference1, true);
     _step2 = new MigrationStep(_reference2, true);
     Assert.IsFalse(_step1.Equals(_step2));
 }
 public void VersionAfterApplication_WhenNotReverting_IsOurVersion()
 {
     _step1 = new MigrationStep(_reference1, false);
       Assert.AreEqual(1, _step1.VersionAfterApplying);
 }
 public void GetHashCode_Always_SameAsReferenceThatIsGoodEnough()
 {
     _step1 = new MigrationStep(_reference1, true);
       Assert.AreEqual(_reference1.GetHashCode(), _step1.GetHashCode());
 }
 public void Equals_SameReference_SameReverting_IsTrue()
 {
     _step1 = new MigrationStep(_reference1, true);
       _step2 = new MigrationStep(_reference1, true);
       Assert.IsTrue(_step1.Equals(_step2));
 }
 public void Equals_DifferentType_IsFalse()
 {
     _step1 = new MigrationStep(_reference1, true);
       Assert.IsFalse(_step1.Equals("HI"));
 }
 public void VersionAfterApplication_WhenReverting_IsPreviousVersion()
 {
     _step1 = new MigrationStep(_reference1, true);
       Assert.AreEqual(0, _step1.VersionAfterApplying);
 }