using MongoDB.Bson; using MongoDB.Driver; using MongoDB.Driver.Core.Clusters; namespace MaksIT.MongoDB.Linq.Tests.Mock { internal class MongoClientMock : IMongoClient { #pragma warning disable CS8625 // Cannot convert null literal to non-nullable reference type. public IMongoDatabase GetDatabase(string name, MongoDatabaseSettings settings = null) { return new MongoDatabaseMock(); } public IClientSessionHandle StartSession(ClientSessionOptions options = null, CancellationToken cancellationToken = default) { return new MongoSessionMock(); } public Task StartSessionAsync(ClientSessionOptions options = null, CancellationToken cancellationToken = default) { return Task.FromResult((IClientSessionHandle)new MongoSessionMock()); } #region not implemented public ICluster Cluster => throw new NotImplementedException(); public MongoClientSettings Settings => throw new NotImplementedException(); public void DropDatabase(string name, CancellationToken cancellationToken = default) { throw new NotImplementedException(); } public void DropDatabase(IClientSessionHandle session, string name, CancellationToken cancellationToken = default) { throw new NotImplementedException(); } public Task DropDatabaseAsync(string name, CancellationToken cancellationToken = default) { throw new NotImplementedException(); } public Task DropDatabaseAsync(IClientSessionHandle session, string name, CancellationToken cancellationToken = default) { throw new NotImplementedException(); } public IAsyncCursor ListDatabaseNames(CancellationToken cancellationToken = default) { throw new NotImplementedException(); } public IAsyncCursor ListDatabaseNames(ListDatabaseNamesOptions options, CancellationToken cancellationToken = default) { throw new NotImplementedException(); } public IAsyncCursor ListDatabaseNames(IClientSessionHandle session, CancellationToken cancellationToken = default) { throw new NotImplementedException(); } public IAsyncCursor ListDatabaseNames(IClientSessionHandle session, ListDatabaseNamesOptions options, CancellationToken cancellationToken = default) { throw new NotImplementedException(); } public Task> ListDatabaseNamesAsync(CancellationToken cancellationToken = default) { throw new NotImplementedException(); } public Task> ListDatabaseNamesAsync(ListDatabaseNamesOptions options, CancellationToken cancellationToken = default) { throw new NotImplementedException(); } public Task> ListDatabaseNamesAsync(IClientSessionHandle session, CancellationToken cancellationToken = default) { throw new NotImplementedException(); } public Task> ListDatabaseNamesAsync(IClientSessionHandle session, ListDatabaseNamesOptions options, CancellationToken cancellationToken = default) { throw new NotImplementedException(); } public IAsyncCursor ListDatabases(CancellationToken cancellationToken = default) { throw new NotImplementedException(); } public IAsyncCursor ListDatabases(ListDatabasesOptions options, CancellationToken cancellationToken = default) { throw new NotImplementedException(); } public IAsyncCursor ListDatabases(IClientSessionHandle session, CancellationToken cancellationToken = default) { throw new NotImplementedException(); } public IAsyncCursor ListDatabases(IClientSessionHandle session, ListDatabasesOptions options, CancellationToken cancellationToken = default) { throw new NotImplementedException(); } public Task> ListDatabasesAsync(CancellationToken cancellationToken = default) { throw new NotImplementedException(); } public Task> ListDatabasesAsync(ListDatabasesOptions options, CancellationToken cancellationToken = default) { throw new NotImplementedException(); } public Task> ListDatabasesAsync(IClientSessionHandle session, CancellationToken cancellationToken = default) { throw new NotImplementedException(); } public Task> ListDatabasesAsync(IClientSessionHandle session, ListDatabasesOptions options, CancellationToken cancellationToken = default) { throw new NotImplementedException(); } public IChangeStreamCursor Watch(PipelineDefinition, TResult> pipeline, ChangeStreamOptions options = null, CancellationToken cancellationToken = default) { throw new NotImplementedException(); } public IChangeStreamCursor Watch(IClientSessionHandle session, PipelineDefinition, TResult> pipeline, ChangeStreamOptions options = null, CancellationToken cancellationToken = default) { throw new NotImplementedException(); } public Task> WatchAsync(PipelineDefinition, TResult> pipeline, ChangeStreamOptions options = null, CancellationToken cancellationToken = default) { throw new NotImplementedException(); } public Task> WatchAsync(IClientSessionHandle session, PipelineDefinition, TResult> pipeline, ChangeStreamOptions options = null, CancellationToken cancellationToken = default) { throw new NotImplementedException(); } public IMongoClient WithReadConcern(ReadConcern readConcern) { throw new NotImplementedException(); } public IMongoClient WithReadPreference(ReadPreference readPreference) { throw new NotImplementedException(); } public IMongoClient WithWriteConcern(WriteConcern writeConcern) { throw new NotImplementedException(); } #endregion #pragma warning restore CS8625 // Cannot convert null literal to non-nullable reference type. } }