예제 #1
0
        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);
        }
예제 #2
0
 public UserRepository(IRadarDatabase radarDatabase)
 {
     _collection = radarDatabase.GetCollection <User>("users");
 }
예제 #3
0
 public TechnologyRepository(IRadarDatabase radarDatabase)
 {
     _collection = radarDatabase.GetCollection <Technology>("technos");
 }
예제 #4
0
 public EntityRepository(IRadarDatabase radarDatabase)
 {
     _collection = radarDatabase.GetCollection <Entity>("entities");
 }
예제 #5
0
 public HistoryRepository(IRadarDatabase radarDatabase)
 {
     _collection = radarDatabase.GetCollection <History>("history");
 }