Exemple #1
0
        public void FlushAfterAdd_PersistsEntity()
        {
            // Arrange
            var account = new XFakeStorageAccount();
            var client  = account.CreateCloudTableClient();
            var table   = client.GetTableReference("Table");

            TableEntityWriter <ITableEntity> product = new TableEntityWriter <ITableEntity>(table);
            const string       partitionKey          = "PK";
            const string       rowKey = "RK";
            DynamicTableEntity entity = new DynamicTableEntity(partitionKey, rowKey);

            product.Add(entity);

            // Act
            product.FlushAsync().GetAwaiter().GetResult();

            // Assert
            DynamicTableEntity persisted = table.Retrieve <DynamicTableEntity>(partitionKey, rowKey);

            Assert.NotNull(persisted);
        }