public void EqualsIsReflexive()
        {
            //Given
            Entity x = new EntityA(Guid.NewGuid());

            //When

            //Then
            Assert.True(x.Equals(x));
        }
        public void EqualsIsSymmetric()
        {
            //Given
            Guid   id = Guid.NewGuid();
            Entity x  = new EntityA(id);
            Entity y  = new EntityA(id);

            //When

            //Then
            Assert.Equal(x.Equals(y), y.Equals(x));
        }
        public void EqualsIsTransitive()
        {
            //Given
            Guid   id = Guid.NewGuid();
            Entity x  = new EntityA(id);
            Entity y  = new EntityA(id);
            Entity z  = new EntityA(id);

            //When

            //Then
            if (x.Equals(y) && y.Equals(z))
            {
                Assert.Equal(x, z);
            }
        }
        public void SuccessiveInvocationsReturnSameValue()
        {
            //Given
            Guid   id      = Guid.NewGuid();
            Entity entity1 = new EntityA(id);
            Entity entity2 = new EntityA(id);

            bool[] results = new bool[10];

            //When
            for (int i = 0; i < results.Length; i++)
            {
                results[i] = entity1.Equals(entity2);
            }

            //Then
            Assert.All(results, b => { if (b != results[0])
                                       {
                                           throw new Exception();
                                       }
                       });
        }