/// <summary>
 /// Unit test context for the specified object and Mongo server URI.
 ///
 /// The last two arguments are provided by the compiler unless
 /// specified explicitly by the caller.
 /// </summary>
 public TemporalMongoUnitTestContext( // TODO - move to a separate class
     object classInstance,
     MongoServerKey mongoServerKey,
     [CallerMemberName] string callerMemberName = null,
     [CallerFilePath] string callerFilePath     = null)
     :
     base(classInstance, mongoServerKey, callerMemberName, callerFilePath)
 {
 }
        /// <summary>
        /// Unit test context for the specified object, database name and Mongo server URI.
        ///
        /// The last two arguments are provided by the compiler unless
        /// specified explicitly by the caller.
        /// </summary>
        public ExternalMongoUnitTestContext(object testObj, string dbNameString, MongoServerKey serverKey,
                                            [CallerMemberName] string testMethodName   = null,
                                            [CallerFilePath] string testSourceFilePath = null) :
            base(testObj, testMethodName, testSourceFilePath)
        {
            var dataSource = new TemporalMongoDataSource
            {
                EnvType     = EnvType.Test, // TODO - change to custom
                EnvGroup    = null,
                EnvName     = dbNameString,
                MongoServer = serverKey
            };

            dataSource.Init(this);

            DataSource = dataSource;

            // Select root dataset
            DataSet = TemporalId.Empty;
        }
        /// <summary>
        /// Unit test context for the specified object and Mongo server URI.
        ///
        /// The last two arguments are provided by the compiler unless
        /// specified explicitly by the caller.
        /// </summary>
        public MongoUnitTestContext(
            object obj,
            MongoServerKey mongoServerKey,
            [CallerMemberName] string callerMemberName = null,
            [CallerFilePath] string callerFilePath     = null)
            :
            base(obj, callerMemberName, callerFilePath)
        {
            // Create data source specified as generic argument
            DataSource = new TDataSource
            {
                EnvType          = EnvType.Test,
                EnvGroup         = TestClassName,
                EnvName          = TestMethodName,
                VersioningMethod = VersioningMethod.Temporal,
                MongoServer      = mongoServerKey
            };

            // Delete (drop) the database to clear the existing data
            DataSource.DeleteDb();

            // Create common dataset and assign it to DataSet property of this context
            DataSet = TemporalId.Empty;
        }