public void TwoInstancesAreEqualIfFieldsAreEqual() { // given var target = new BeaconCacheRecord(1234L, "abc"); var other = new BeaconCacheRecord(1234L, "abc"); // then Assert.That(target.Equals(other), Is.True); // and when setting send flag target.MarkForSending(); other.MarkForSending(); // then Assert.That(target.Equals(other), Is.True); }
public void NullIsNotEqual() { // given var target = new BeaconCacheRecord(0L, "abc"); // then Assert.That(target.Equals(null), Is.False); }
public void SameInstancesAreEqual() { // given var target = new BeaconCacheRecord(0L, "abc"); // then Assert.That(target.Equals(target), Is.True); }
public void ADifferentTypeIsNotConsideredEqual() { // given var target = new BeaconCacheRecord(0L, "abc"); // then Assert.That(target.Equals("abc"), Is.False); }
public void TwoInstancesAreNotEqualIfDataDiffers() { // given var target = new BeaconCacheRecord(1234L, "abc"); var other = new BeaconCacheRecord(1234L, "abcd"); // then Assert.That(target.Equals(other), Is.False); }
public void TwoInstancesAreNotEqualIfMarkedForSendingDiffers() { // given var target = new BeaconCacheRecord(1234L, "abc"); var other = new BeaconCacheRecord(1234L, "abc"); other.MarkForSending(); // then Assert.That(target.Equals(other), Is.False); }