public async Task EnsureProvisioningAsync_ShouldNotCallUpdateOnClientWhenValuesAreTheSame() { var readsConfiguration = new AutoscalingConfiguration {EnableAutoscaling = true}; var writesConfiguration = new AutoscalingConfiguration {EnableAutoscaling = true}; var configurationSet = new TableAutoscalingConfigurationSet { TableName = tableName, DemoMode = false, Reads = readsConfiguration, Writes = writesConfiguration, }; var provisioned = new DynamoDbTableThroughput { ReadThroughput = 500, WriteThroughput = 1000 }; var updated = new DynamoDbTableThroughput { ReadThroughput = 500, WriteThroughput = 1000 }; await tableProvisioner.ProvisionAsync(configurationSet, provisioned, updated); throughputClientMock.Verify( client => client.SetTableThroughputLevelAsync(tableName, 500, 1000, default(CancellationToken)), Times.Never); }
public async Task EnsureProvisioningAsync_ShouldCallUpdateOnClientOnlyWithEnabledThroughput() { var configurationSet = new TableAutoscalingConfigurationSet { TableName = tableName, DemoMode = false, Reads = new AutoscalingConfiguration { EnableAutoscaling = false }, Writes = new AutoscalingConfiguration { EnableAutoscaling = true }, }; var provisioned = new DynamoDbTableThroughput { ReadThroughput = 500, WriteThroughput = 1000 }; var updated = new DynamoDbTableThroughput { ReadThroughput = 1000, WriteThroughput = 2000 }; await tableProvisioner.ProvisionAsync(configurationSet, provisioned, updated); throughputClientMock.Verify( client => client.SetTableThroughputLevelAsync(tableName, 500, 2000, default(CancellationToken)), Times.Once); }