예제 #1
0
        public void equals_positive_with_both_being_null()
        {
            var milestone1 = new Milestone();
            var milestone2 = new Milestone();

            milestone1.ShouldEqual(milestone2);
            milestone2.ShouldEqual(milestone1);
        }
예제 #2
0
        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();
        }
예제 #3
0
        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);
        }
예제 #4
0
        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();
        }
예제 #5
0
        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);
        }
예제 #6
0
 public bool Equals(Milestone other)
 {
     if (ReferenceEquals(null, other)) return false;
     if (ReferenceEquals(this, other)) return true;
     return other._timestamp.Equals(_timestamp);
 }