Entity_with_no_signature_properties_preserves_hashcode_when_transitioning_from_transient_to_persistent()
        {
            var sut = new ObjectWithNoDomainSignatureProperties();

            Assert.That(sut.IsTransient());

            int hashcodeWhenTransient = sut.GetHashCode();

            sut.SetIdTo(1);

            Assert.That(sut.IsTransient(), Is.False);
            Assert.That(sut.GetHashCode(), Is.EqualTo(hashcodeWhenTransient));
        }
Example #2
0
        Entity_with_no_signature_properties_preserves_hashcode_when_transitioning_from_transient_to_persistent()
        {
            var obj = new ObjectWithNoDomainSignatureProperties();

            obj.IsTransient().Should().BeTrue();

            int hashcodeWhenTransient = obj.GetHashCode();

            obj.SetIdTo(1);

            obj.IsTransient().Should().BeFalse();
            obj.GetHashCode().Should().Be(hashcodeWhenTransient);
        }
Example #3
0
        EntityWithNoSignaturePropertiesPreservesHashcodeWhenTransitioningFromTransientToPersistent()
        {
            var sut = new ObjectWithNoDomainSignatureProperties();

            Assert.IsTrue(sut.IsTransient());

            int hashcodeWhenTransient = sut.GetHashCode();

            sut.SetIdTo(1);

            Assert.IsFalse(sut.IsTransient());
            Assert.AreEqual(sut.GetHashCode(), hashcodeWhenTransient);
        }