public void Convert_IfPartitionKeyIsPrivate_Ignores()
        {
            // Arrange
            const string expectedRowKey = "RK";
            IConverter <PocoWithPrivatePartitionKey, TableEntity> product =
                CreateProductUnderTest <PocoWithPrivatePartitionKey>();
            PocoWithPrivatePartitionKey input = new PocoWithPrivatePartitionKey
            {
                PartitionKeyPublic = "UnexpectedPK",
                RowKey             = expectedRowKey
            };
            // Act
            TableEntity actual = product.Convert(input);

            // Assert
            Assert.NotNull(actual);
            Assert.Null(actual.PartitionKey);
            Assert.AreSame(expectedRowKey, actual.RowKey);
        }
Example #2
0
        public void Convert_IfPartitionKeyIsPrivate_Ignores()
        {
            // Arrange
            const string expectedRowKey = "RK";
            IConverter <ITableEntity, PocoWithPrivatePartitionKey> product =
                CreateProductUnderTest <PocoWithPrivatePartitionKey>();
            DynamicTableEntity entity = new DynamicTableEntity
            {
                PartitionKey = "UnexpectedPK",
                RowKey       = expectedRowKey
            };

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

            // Assert
            Assert.NotNull(actual);
            Assert.Null(actual.PartitionKeyPublic);
            Assert.Same(expectedRowKey, actual.RowKey);
        }