コード例 #1
0
        public void Convert_IfPartitionKeyIsReadOnly_PopulatesPartitionKey()
        {
            // Arrange
            const string expectedPartitionKey = "PK";
            IConverter <PocoWithReadOnlyPartitionKey, TableEntity> product =
                CreateProductUnderTest <PocoWithReadOnlyPartitionKey>();
            PocoWithReadOnlyPartitionKey input = new PocoWithReadOnlyPartitionKey
            {
                WritePartitionKey = expectedPartitionKey
            };
            // Act
            TableEntity actual = product.Convert(input);

            // Assert
            Assert.NotNull(actual);
            Assert.AreSame(expectedPartitionKey, actual.PartitionKey);
        }
コード例 #2
0
        public void Convert_IfPartitionKeyIsReadOnly_Ignores()
        {
            // Arrange
            const string expectedRowKey = "RK";
            IConverter <TableEntity, PocoWithReadOnlyPartitionKey> product =
                CreateProductUnderTest <PocoWithReadOnlyPartitionKey>();
            TableEntity entity = new TableEntity
            {
                RowKey = expectedRowKey
            };
            // Act
            PocoWithReadOnlyPartitionKey actual = product.Convert(entity);

            // Assert
            Assert.NotNull(actual);
            Assert.AreSame(expectedRowKey, actual.RowKey);
        }