public void CanEquateTimes_Object_NonTime()
        {
            var t = new TimeOfDay();
            var b = t.Equals(0);

            Assert.False(b);
        }
示例#2
0
 public bool Equals(PMLEvent otherEvent)
 {
     return(TimeOfDay.Equals(otherEvent.TimeOfDay) &&
            (ProcessIndex == otherEvent.ProcessIndex) &&
            (TID == otherEvent.TID) &&
            (Operation.Equals(otherEvent.Operation, StringComparison.CurrentCultureIgnoreCase)) &&
            (Detail.Equals(otherEvent.Detail, StringComparison.CurrentCultureIgnoreCase)));
 }
        public void CanEquateTimes_Object_NotEqual()
        {
            var t1 = new TimeOfDay(0, 0);
            var t2 = new TimeOfDay(0, 1);

            var b = t1.Equals((object)t2);

            Assert.False(b);
        }
        public void CanEquateTimes_Instance_NotEqual()
        {
            var t1 = new TimeOfDay(0, 0);
            var t2 = new TimeOfDay(0, 1);

            var b = t1.Equals(t2);

            Assert.False(b);
        }
        public void CanEquateTimes_Static_NotEqual()
        {
            var t1 = new TimeOfDay(0, 0);
            var t2 = new TimeOfDay(0, 1);

            var b = TimeOfDay.Equals(t1, t2);

            Assert.False(b);
        }
示例#6
0
 public override bool Equals(object obj)
 {
     return(obj is LapEntry entry &&
            TimeOfDay.Equals(entry.TimeOfDay) &&
            DriverNumber == entry.DriverNumber &&
            DriverName == entry.DriverName &&
            LapNumber == entry.LapNumber &&
            LapTime.Equals(entry.LapTime) &&
            AvarageSpeed == entry.AvarageSpeed);
 }
示例#7
0
 protected bool IsDifferent(TimeOfDay a, TimeOfDay b, PropertyPath path)
 {
     if (!TimeOfDay.Equals(a, b))
     {
         Report(path, $"different values '{a}' != '{b}'"); return(true);
     }
     else
     {
         return(false);
     }
 }
 public bool Equals(DateTimeBase other)
 {
     return(other != null &&
            Ticks == other.Ticks &&
            Second == other.Second &&
            Date == other.Date &&
            Month == other.Month &&
            Minute == other.Minute &&
            Millisecond == other.Millisecond &&
            Hour == other.Hour &&
            DayOfYear == other.DayOfYear &&
            DayOfWeek == other.DayOfWeek &&
            Day == other.Day &&
            TimeOfDay.Equals(other.TimeOfDay) &&
            Year == other.Year &&
            Offset == other.Offset &&
            Value == other.Value);
 }
示例#9
0
        public void EqualityComparer_ShouldReturnValidResult()
        {
            // Arrange.
            var targetOne   = new TimeOfDay(TimeZoneInfo.Local, 4, 30, 0, 0);
            var targetTwo   = new TimeOfDay(TimeZoneInfo.Local, 4, 30);
            var targetThree = new TimeOfDay(TimeZoneInfo.Local, 4, 30, 0, 1);

            // Act.
            var resultOne   = targetOne.Equals(targetTwo);
            var resultTwo   = targetTwo.Equals(targetThree);
            var resultThree = targetTwo == targetOne;
            var resultFour  = targetThree == targetOne;
            var resultFive  = targetOne != targetThree;
            var resultSix   = targetTwo != targetOne;

            // Assert.
            resultOne.Should().BeTrue();
            resultTwo.Should().BeFalse();
            resultThree.Should().BeTrue();
            resultFour.Should().BeFalse();
            resultFive.Should().BeTrue();
            resultSix.Should().BeFalse();
        }
 public void CanEquateTimes_Object_Null()
 {
     var t = new TimeOfDay();
     var b = t.Equals(null);
     Assert.False(b);
 }
        public void CanEquateTimes_Object_NotEqual()
        {
            var t1 = new TimeOfDay(0, 0);
            var t2 = new TimeOfDay(0, 1);

            var b = t1.Equals((object)t2);

            Assert.False(b);
        }
        public void CanEquateTimes_Instance_NotEqual()
        {
            var t1 = new TimeOfDay(0, 0);
            var t2 = new TimeOfDay(0, 1);

            var b = t1.Equals(t2);

            Assert.False(b);
        }