Exemplo n.º 1
0
        public void TimeStamped_Equals()
        {
            var ti = new Timestamped <int>(42, new DateTimeOffset());

            Assert.IsFalse(ti.Equals("x"));
            Assert.IsTrue(ti.Equals(ti));

            var t2 = new Timestamped <int>(43, new DateTimeOffset());

            Assert.IsFalse(ti.Equals(t2));

            var t3 = new Timestamped <int>(42, new DateTimeOffset().AddDays(1));

            Assert.IsFalse(ti.Equals(t3));

            var t4 = new Timestamped <int>(42, new DateTimeOffset());

            Assert.IsTrue(ti.Equals(t4));
        }
Exemplo n.º 2
0
        /// <summary>
        /// Compares two EVSE identifications for equality.
        /// </summary>
        /// <param name="EVSEStatusChange">An EVSE identification to compare with.</param>
        /// <returns>True if both match; False otherwise.</returns>
        public Boolean Equals(EVSEStatusChange EVSEStatusChange)
        {
            if ((Object)EVSEStatusChange == null)
            {
                return(false);
            }

            return(_Id.Equals(EVSEStatusChange._Id) &&
                   _OldStatus.Equals(EVSEStatusChange._OldStatus) &&
                   _NewStatus.Equals(EVSEStatusChange._NewStatus));
        }
Exemplo n.º 3
0
        public void Timestamped_Equals()
        {
            var ti = new Timestamped<int>(42, new DateTimeOffset());
            Assert.False(ti.Equals("x"));
            Assert.False(((object)ti).Equals("x"));
            Assert.True(ti.Equals(ti));
            Assert.True(((object)ti).Equals(ti));

            var t2 = new Timestamped<int>(43, new DateTimeOffset());
            Assert.False(ti.Equals(t2));
            Assert.False(((object)ti).Equals(t2));

            var t3 = new Timestamped<int>(42, new DateTimeOffset().AddDays(1));
            Assert.False(ti.Equals(t3));
            Assert.False(((object)ti).Equals(t3));

            var t4 = new Timestamped<int>(42, new DateTimeOffset());
            Assert.True(ti.Equals(t4));
            Assert.True(((object)ti).Equals(t4));
        }