public HistoryRepositoryTests() { RadarTechno.History.History[] histories = new[] { new RadarTechno.History.History("author", "entity-technology", "id1", "diff"), new RadarTechno.History.History("author", "entity-technology", "id1", "diff2"), new RadarTechno.History.History("author", "entity-technology", "id1", "diff3"), new RadarTechno.History.History("author", "entity-technology", "id2", "diff") }; _mongoRunner = MongoDbRunner.Start(); MongoClient client = new MongoClient(_mongoRunner.ConnectionString); IMongoDatabase database = client.GetDatabase("radar-techno"); var collection = database.GetCollection <RadarTechno.History.History>("history"); collection.InsertMany(histories); var databaseSettings = new DatabaseSettings() { ConnectionString = _mongoRunner.ConnectionString, Database = "radar-techno" }; IOptions <DatabaseSettings> options = Options.Create <DatabaseSettings>(databaseSettings); _database = new RadarDatabase(options); _repository = new HistoryRepository(_database); }
public UserRepository(IRadarDatabase radarDatabase) { _collection = radarDatabase.GetCollection <User>("users"); }
public TechnologyRepository(IRadarDatabase radarDatabase) { _collection = radarDatabase.GetCollection <Technology>("technos"); }
public EntityRepository(IRadarDatabase radarDatabase) { _collection = radarDatabase.GetCollection <Entity>("entities"); }
public HistoryRepository(IRadarDatabase radarDatabase) { _collection = radarDatabase.GetCollection <History>("history"); }