public void DropOne(IClientSessionHandle session, string name, DropIndexOptions options, CancellationToken cancellationToken = default)
 {
     if (!indexes.Remove(name))
     {
         throw new InvalidOperationException();
     }
 }
        public void MaxTime_set_should_have_expected_result(
            [Values(null, -10000, 0, 1, 9999, 10000, 10001)] int?maxTimeTicks)
        {
            var subject = new DropIndexOptions();
            var maxTime = maxTimeTicks == null ? (TimeSpan?)null : TimeSpan.FromTicks(maxTimeTicks.Value);

            subject.MaxTime = maxTime;

            subject.MaxTime.Should().Be(maxTime);
        }
        public void MaxTime_get_should_return_expected_result()
        {
            var subject = new DropIndexOptions {
                MaxTime = TimeSpan.FromSeconds(123)
            };

            var result = subject.MaxTime;

            result.Should().Be(TimeSpan.FromSeconds(123));
        }
        public void MaxTime_set_should_throw_when_value_is_invalid(
            [Values(-10001, -9999, -1)] long maxTimeTicks)
        {
            var subject = new DropIndexOptions();
            var value   = TimeSpan.FromTicks(maxTimeTicks);

            var exception = Record.Exception(() => subject.MaxTime = value);

            var e = exception.Should().BeOfType <ArgumentOutOfRangeException>().Subject;

            e.ParamName.Should().Be("value");
        }
Пример #5
0
 public void DropOne(IClientSessionHandle session, string name, DropIndexOptions options, CancellationToken cancellationToken = default)
 {
 }
Пример #6
0
 public void DropOne(string name, DropIndexOptions options, CancellationToken cancellationToken = default)
 {
 }
Пример #7
0
 public Task DropAllAsync(IClientSessionHandle session, DropIndexOptions options, CancellationToken cancellationToken = default) => null;
Пример #8
0
 public Task DropAllAsync(DropIndexOptions options, CancellationToken cancellationToken = default) => null;
Пример #9
0
 public void DropAll(DropIndexOptions options, CancellationToken cancellationToken = default)
 {
 }
Пример #10
0
 public void DropAll(IClientSessionHandle session, DropIndexOptions options, CancellationToken cancellationToken = default)
 {
 }
Пример #11
0
 public Task DropOneAsync(string name, DropIndexOptions options, CancellationToken cancellationToken = default) => null;
Пример #12
0
 public Task DropOneAsync(IClientSessionHandle session, string name, DropIndexOptions options, CancellationToken cancellationToken = default) => null;
        public Task DropOneAsync(IClientSessionHandle session, string name, DropIndexOptions options, CancellationToken cancellationToken = default)
        {
            DropOne(session, name, options, cancellationToken);

            return(Task.CompletedTask);
        }
 public Task DropOneAsync(string name, DropIndexOptions options, CancellationToken cancellationToken = default)
 {
     return(DropOneAsync(null, name, options, cancellationToken));
 }
        public Task DropAllAsync(IClientSessionHandle session, DropIndexOptions options, CancellationToken cancellationToken = default)
        {
            DropAll(session, options, cancellationToken);

            return(Task.CompletedTask);
        }
 public Task DropAllAsync(DropIndexOptions options, CancellationToken cancellationToken = default)
 {
     return(DropAllAsync(null, options, cancellationToken));
 }