public void Convert_IfOtherPropertySetterIsPrivate_Ignores()
        {
            // Arrange
            const string expectedPartitionKey = "PK";
            IConverter <TableEntity, PocoWithPrivateOtherPropertySetter> product =
                CreateProductUnderTest <PocoWithPrivateOtherPropertySetter>();
            TableEntity entity = new TableEntity
            {
                PartitionKey      = expectedPartitionKey,
                ["OtherProperty"] = 456
            };
            // Act
            PocoWithPrivateOtherPropertySetter actual = product.Convert(entity);

            // Assert
            Assert.NotNull(actual);
            Assert.Null(actual.OtherProperty);
            Assert.AreSame(expectedPartitionKey, actual.PartitionKey);
        }
Beispiel #2
0
        public void Convert_IfOtherPropertySetterIsPrivate_Ignores()
        {
            // Arrange
            const string expectedPartitionKey = "PK";
            IConverter <ITableEntity, PocoWithPrivateOtherPropertySetter> product =
                CreateProductUnderTest <PocoWithPrivateOtherPropertySetter>();
            DynamicTableEntity entity = new DynamicTableEntity
            {
                PartitionKey = expectedPartitionKey,
                Properties   = new Dictionary <string, EntityProperty>
                {
                    { "OtherProperty", new EntityProperty(456) }
                }
            };

            // Act
            PocoWithPrivateOtherPropertySetter actual = product.Convert(entity);

            // Assert
            Assert.NotNull(actual);
            Assert.Null(actual.OtherProperty);
            Assert.Same(expectedPartitionKey, actual.PartitionKey);
        }