/// <summary> /// Create from data source, base collection, and typed collection objects. /// /// This object should be constructed inside a data source. It should not /// be used by other classes directly. /// </summary> public TemporalMongoCollection( TemporalMongoDataSource dataSource, IMongoCollection <Record> baseCollection, IMongoCollection <TRecord> typedCollection) { DataSource = dataSource; BaseCollection = baseCollection; TypedCollection = typedCollection; }
/// <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; }