public void equals_positive_with_both_being_null() { var milestone1 = new Milestone(); var milestone2 = new Milestone(); milestone1.ShouldEqual(milestone2); milestone2.ShouldEqual(milestone1); }
public void happened_before() { var time = DateTime.Today.AddHours(8).ToUniversalTime(); var milestone = new Milestone(time); milestone.HappenedBefore(time.AddMinutes(-1)).ShouldBeFalse(); milestone.HappenedBefore(time.AddDays(-1)).ShouldBeFalse(); milestone.HappenedBefore(time.AddDays(1)).ShouldBeTrue(); }
public void equals_positive_with_matching_times() { var time = DateTime.Today.AddHours(8); var milestone1 = new Milestone(time); var milestone2 = new Milestone(time); milestone1.ShouldEqual(milestone2); milestone2.ShouldEqual(milestone1); }
public void clear() { var time = DateTime.Today.AddHours(8); var milestone1 = new Milestone(time); milestone1.IsTrue.ShouldBeTrue(); milestone1.Clear(); milestone1.Timestamp.ShouldBeNull(); milestone1.IsTrue.ShouldBeFalse(); }
public void equals_negative() { var time = DateTime.Today.AddHours(8); var milestone1 = new Milestone(time); var milestone2 = new Milestone(); var milestone3 = new Milestone(time.AddHours(1)); milestone1.ShouldNotEqual(milestone2); milestone1.ShouldNotEqual(milestone3); milestone2.ShouldNotEqual(milestone1); milestone2.ShouldNotEqual(milestone3); milestone3.ShouldNotEqual(milestone1); milestone3.ShouldNotEqual(milestone2); }
public bool Equals(Milestone other) { if (ReferenceEquals(null, other)) return false; if (ReferenceEquals(this, other)) return true; return other._timestamp.Equals(_timestamp); }