public void Convert_IfRowKeyIsStatic_Ignores()
        {
            // Arrange
            const string expectedPartitionKey = "PK";
            IConverter <TableEntity, PocoWithStaticRowKey> product = CreateProductUnderTest <PocoWithStaticRowKey>();
            TableEntity entity = new TableEntity
            {
                PartitionKey = expectedPartitionKey,
                RowKey       = "UnexpectedRK"
            };
            // Act
            PocoWithStaticRowKey actual = product.Convert(entity);

            // Assert
            Assert.NotNull(actual);
            Assert.Null(PocoWithStaticRowKey.RowKey);
            Assert.AreSame(expectedPartitionKey, actual.PartitionKey);
        }
示例#2
0
        public void Convert_IfRowKeyIsStatic_Ignores()
        {
            // Arrange
            const string expectedPartitionKey = "PK";
            var          product = CreateProductUnderTest <PocoWithStaticRowKey>();

            PocoWithStaticRowKey.RowKey = "UnexpectedRK";
            PocoWithStaticRowKey input = new PocoWithStaticRowKey
            {
                PartitionKey = expectedPartitionKey
            };
            // Act
            TableEntity actual = product.Convert(input);

            // Assert
            Assert.NotNull(actual);
            Assert.Null(actual.RowKey);
            Assert.AreSame(expectedPartitionKey, actual.PartitionKey);
        }