public void TryApplyDefaultRetentionPolicy() { RetentionPolicyOptions options = new RetentionPolicyOptions(); bool result = options.TryApply(out var clause); Assert.False(result); Assert.Null(clause); }
public void TryApplyRetentionPolicy( int?duration, int?replication, int?shardDuration, string name, bool expected, string expectedClause) { RetentionPolicyOptions options = new RetentionPolicyOptions { Name = name, Duration = duration.HasValue ? TimeSpan.FromMinutes(duration.Value) : (TimeSpan?)null, Replication = replication, ShardDuration = shardDuration.HasValue ? TimeSpan.FromMinutes(shardDuration.Value) : (TimeSpan?)null }; bool result = options.TryApply(out var clause); Assert.Equal(expected, result); Assert.Equal(expectedClause, clause); }