Пример #1
0
        public void EntityEquals_Success_Should_ReturnTrue_Detail_SameReference()
        {
            // Arrange
            IEntity entity = new OtherEntity(1, 2);


            // Assert
            entity.EntityEquals(entity).Should().BeTrue();
        }
Пример #2
0
        public void EntityEquals_Success_Should_ReturnTrue_Detail_FirstEntityAllKeysNull()
        {
            // Arrange
            IEntity entity  = new OtherEntity(null, null);
            IEntity entity1 = new OtherEntity(3, 2);


            // Assert
            entity.EntityEquals(entity1).Should().BeFalse();
        }
Пример #3
0
        public void EntityEquals_Success_Should_ReturnTrue_Detail_OneDifferentKeyValues()
        {
            // Arrange
            IEntity entity  = new OtherEntity(1, 2);
            IEntity entity1 = new OtherEntity(3, 2);


            // Assert
            entity.EntityEquals(entity1).Should().BeFalse();
        }
Пример #4
0
        public void EntityEquals_Success_Should_ReturnFalse_Detail_OtherIsDifferentTypeAndHAsDifferentKeyLength()
        {
            // Arrange
            IEntity entity  = new OtherEntity(1, 2);
            IEntity entity1 = new OtherAnotherOtherEntity(12);


            // Assert
            entity.EntityEquals(entity1).Should().BeFalse();
        }
Пример #5
0
        public void EntityEquals_Success_Should_ReturnFalse_Detail_OtherIsNull()
        {
            // Arrange
            IEntity entity  = new OtherEntity(1, 2);
            IEntity?entity1 = null;


            // Assert
            entity.EntityEquals(entity1).Should().BeFalse();
        }
Пример #6
0
        public void EntityEquals_Success_Should_ReturnTrue_Detail_SecondEntitySecondKeyIsNull()
        {
            // Arrange
            IEntity entity  = new OtherEntity(1, 2);
            IEntity entity1 = new OtherEntity(2, null);


            // Assert
            entity.EntityEquals(entity1).Should().BeFalse();
        }
Пример #7
0
        public void ToString_Success_Should_ReturnEntityAndKeyInfo()
        {
            // Arrange
            var     key1   = 1;
            var     key2   = 2;
            IEntity entity = new OtherEntity(key1, key2);


            // Assert
            entity.ToString().Should().Be($"[{nameof(OtherEntity)}] | [{key1}, {key2}]");
        }