public ReplicationScheduledAction(ReplicationManager replication)
        {
            _replication = replication;

            // get config
            _isMaster = replication.IsMaster;
            _isSlave = replication.IsSlave;
        }
        public override void SetUp()
        {
            base.SetUp();
            
            // create a filesystem for replication and use it as storage
            fsf = CreateFileSystemFactory();
            Storage = new ReplicationStorageFileSystemN2(activator, fsf, definitions, persister);

            // create a master replicator
            MasterFlushable = new FakeFlushable();
            Master = new ReplicationManager(persister, new XmlFinder(repository), Storage, fsf, 
                new DatabaseSection(), 
                new FakeSecurityManager(), 
                null,
                MasterFlushable);
            Master.SetUnitTestMode(true);

            // create a separate slave repository
            SlaveRepo = new XmlContentItemRepository(activator, fs, definitions, null, null);
            var slavesource = TestSupport.SetupContentSource(SlaveRepo);
            SlavePersister = new ContentPersister(slavesource, SlaveRepo);
            new BehaviorInvoker(SlavePersister, new DefinitionMap()).Start();

            // create a slave replicator
            SlaveFlushable = new FakeFlushable();
            Slave = new ReplicationManager(SlavePersister, new XmlFinder(SlaveRepo), Storage, fsf,
                new DatabaseSection(),
                new FakeSecurityManager(),
                null,
                SlaveFlushable);
            Slave.SetUnitTestMode(false);
        }