コード例 #1
0
        public void Setup()
        {
            var pages = new MemoryPageReaderWriter();
            var checkpoint = new MemoryCheckpointReaderWriter();

            Writer = new MessageWriter(pages, checkpoint);
            Reader = new MessageReader(checkpoint, pages);
            CheckpointReader = checkpoint;
            PageWriter = pages;
            Writer.Init();
        }
コード例 #2
0
        public void Setup()
        {
            _folder = Path.Combine(Path.GetTempPath(), "syntethic_test");
            if (!Directory.Exists(_folder)) {
                Directory.CreateDirectory(_folder);
            }

            var streamFile = new FileInfo(Path.Combine(_folder, Constants.StreamFileName));
            var checkFile = new FileInfo(Path.Combine(_folder, Constants.PositionFileName));

            var pageWriter = new FilePageWriter(streamFile);
            var pageReader = new FilePageReader(streamFile);
            var checkReader = new FileCheckpointReader(checkFile);
            var checkWriter = new FileCheckpointWriter(checkFile);

            Writer = new MessageWriter(pageWriter, checkWriter);
            Reader = new MessageReader(checkReader, pageReader);
            CheckpointReader = checkReader;
            PageWriter = pageWriter;
            Writer.Init();
        }