示例#1
0
        public void AddDatabases()
        {
            var migrationManager = new MigrationManager();

            var databaseMock = new Mock <IMongoDatabase>();

            Assert.Throws <ArgumentNullException>(() => migrationManager.AddDatabase(null, "general"));
            Assert.Throws <ArgumentNullException>(() => migrationManager.AddDatabaseConnection(null, "general"));
            Assert.Throws <ArgumentNullException>(() => migrationManager.AddDatabase(databaseMock.Object, null));
            Assert.Throws <ArgumentNullException>(() => migrationManager.AddDatabase(databaseMock.Object, ""));

            Assert.DoesNotThrow(() => migrationManager.AddDatabase(databaseMock.Object, "general"));
        }