public void UpsertStructureSet_WhenDbSettingsDoesNotAllowAnyChanges_UpserterIsNeverCalled()
        {
            var settings = new Mock<IDbSettings>();
            settings.SetupGet(f => f.AllowDynamicSchemaCreation).Returns(false);
            settings.SetupGet(f => f.AllowDynamicSchemaUpdates).Returns(false);
            var dbFake = new Mock<ISisoDatabase>();
            dbFake.SetupGet(f => f.Settings).Returns(settings.Object);
            var upserterFake = new Mock<IDbSchemaUpserter>();
            var dbClientFake = CreateDbClientFake();

            var manager = new DbSchemas(dbFake.Object, upserterFake.Object);
            manager.Upsert(_structureSchema, dbClientFake.Object);

            upserterFake.Verify(f => f.Upsert(_structureSchema, dbClientFake.Object, false, false), Times.Never());
        }
        public void UpsertStructureSet_WhenCalledTwice_UpserterIsCalledOnceNotTwice()
        {
            var settings = new Mock<IDbSettings>();
            settings.SetupGet(f => f.AllowDynamicSchemaCreation).Returns(true);
            settings.SetupGet(f => f.AllowDynamicSchemaUpdates).Returns(true);
            var dbFake = new Mock<ISisoDatabase>();
            dbFake.SetupGet(f => f.Settings).Returns(settings.Object);
            var upserterFake = new Mock<IDbSchemaUpserter>();
            var dbClientFake = CreateDbClientFake();

            var manager = new DbSchemas(dbFake.Object, upserterFake.Object);
            manager.Upsert(_structureSchema, dbClientFake.Object);
			manager.Upsert(_structureSchema, dbClientFake.Object);

            upserterFake.Verify(f => f.Upsert(_structureSchema, dbClientFake.Object, true, true), Times.Once());
        }
        public void DropStructureSet_WhenCalledTwice_DropperIsCalledTwice()
        {
			var upserterFake = new Mock<IDbSchemaUpserter>();
            var dbClientFake = CreateDbClientFake();

            var manager = new DbSchemas(Mock.Of<ISisoDatabase>(), upserterFake.Object);
            manager.Drop(_structureSchema, dbClientFake.Object);
            manager.Drop(_structureSchema, dbClientFake.Object);

            dbClientFake.Verify(f => f.Drop(_structureSchema), Times.Exactly(2));
        }