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"); }
public void DropOne(IClientSessionHandle session, string name, DropIndexOptions options, CancellationToken cancellationToken = default) { }
public void DropOne(string name, DropIndexOptions options, CancellationToken cancellationToken = default) { }
public Task DropAllAsync(IClientSessionHandle session, DropIndexOptions options, CancellationToken cancellationToken = default) => null;
public Task DropAllAsync(DropIndexOptions options, CancellationToken cancellationToken = default) => null;
public void DropAll(DropIndexOptions options, CancellationToken cancellationToken = default) { }
public void DropAll(IClientSessionHandle session, DropIndexOptions options, CancellationToken cancellationToken = default) { }
public Task DropOneAsync(string name, DropIndexOptions options, CancellationToken cancellationToken = default) => null;
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)); }