Пример #1
0
        public MongoDbDataStorageServiceTests()
        {
            _configuration = new MongoDbStorageServiceConfiguration <TestableStorageEntity>
            {
                DatabaseName   = "Hello",
                CollectionName = "World"
            };
            _mockMongoClient = new Mock <IMongoClient>();
            _mockDatabase    = new Mock <IMongoDatabase>();
            _mockCollection  = new Mock <IMongoCollection <TestableStorageEntity> >();

            _mockMongoClient.Setup(x => x.GetDatabase(
                                       It.IsAny <string>(),
                                       It.IsAny <MongoDatabaseSettings>()))
            .Returns(_mockDatabase.Object);

            _mockDatabase.Setup(x => x.GetCollection <TestableStorageEntity>(
                                    It.IsAny <string>(),
                                    It.IsAny <MongoCollectionSettings>()))
            .Returns(_mockCollection.Object);
        }
Пример #2
0
 public PrinterStorageService(
     IMongoClient mongoClient,
     MongoDbStorageServiceConfiguration <Printer> settings)
     : base(mongoClient, settings)
 {
 }
 public ConfigurationDataStorageService(
     IMongoClient mongoClient,
     MongoDbStorageServiceConfiguration <Configuration> settings)
     : base(mongoClient, settings)
 {
 }
 public TestableMongoDbDataStorageService(
     IMongoClient mongoClient,
     MongoDbStorageServiceConfiguration <TestableStorageEntity> settings)
     : base(mongoClient, settings)
 {
 }