protected internal IPersistence Create(bool dropOnInit)
        {
            _mongoConnectionString = GetPartitionsConnectionString();
            _options = GetMongoPersistenceOptions();
            if (dropOnInit)
            {
                _options.DropOnInit = true;
            }
            _mongoPersistence = CreatePersistence(_options);

            _mongoPersistence.InitAsync(CancellationToken.None).Wait();

            return(_mongoPersistence);
        }
        private IPersistence Create()
        {
            var mongo = Environment.GetEnvironmentVariable("NSTORE_MONGODB");

            if (string.IsNullOrWhiteSpace(mongo))
            {
                throw new TestMisconfiguredException("NSTORE_MONGODB environment variable not set");
            }

            _options = new MongoPersistenceOptions
            {
                PartitionsConnectionString = mongo,
                UseLocalSequence           = true,
                PartitionsCollectionName   = "partitions_" + GetType().Name + "_" + _testRunId,
                SequenceCollectionName     = "seq_" + _testRunId,
                DropOnInit = true
            };
            _mongoPersistence = CreatePersistence(_options);

            _mongoPersistence.InitAsync(CancellationToken.None).Wait();

            return(_mongoPersistence);
        }