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); }
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(); }
public void VersionAfterApplication_WhenReverting_IsPreviousVersion() { _step1 = new MigrationStep(_reference1, true); Assert.AreEqual(0, _step1.VersionAfterApplying); }
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_DifferentType_IsFalse() { _step1 = new MigrationStep(_reference1, true); Assert.IsFalse(_step1.Equals("HI")); }
public void Equals_DifferentReference_SameReverting_IsFalse() { _step1 = new MigrationStep(_reference1, true); _step2 = new MigrationStep(_reference2, true); Assert.IsFalse(_step1.Equals(_step2)); }
public void Equals_SameReference_SameReverting_IsTrue() { _step1 = new MigrationStep(_reference1, true); _step2 = new MigrationStep(_reference1, true); Assert.IsTrue(_step1.Equals(_step2)); }