public async Task InsertOrMergeEntityAsync_ExistingEntity_UpdatesEntityInTable() { ITableServiceClient client = new TableServiceClient(_accountSettings); var tableName = _util.GenerateSampleTableName(); _util.CreateTable(tableName); var sampleEntity = new SampleEntity() { PartitionKey = "1", RowKey = "A", ExtraValue = "Extra" }; _util.InsertTableEntity(tableName, sampleEntity.PartitionKey, sampleEntity.RowKey); await client.InsertOrMergeEntityAsync(tableName, sampleEntity); _util.AssertEntityExists(tableName, sampleEntity); var entity = _util.GetEntity<SampleMSEntity>(tableName, sampleEntity.PartitionKey, sampleEntity.RowKey); Assert.AreEqual(sampleEntity.ExtraValue, entity.ExtraValue); }
public async Task InsertOrMergeEntityAsync_ValidTable_InsertsEntityInTable() { ITableServiceClient client = new TableServiceClient(_accountSettings); var tableName = _util.GenerateSampleTableName(); _util.CreateTable(tableName); var sampleEntity = new SampleEntity() { PartitionKey = "1", RowKey = "A" }; await client.InsertOrMergeEntityAsync(tableName, sampleEntity); _util.AssertEntityExists(tableName, sampleEntity); }