コード例 #1
0
        public void SliceSizeReturnsExpectedResult()
        {
            var size = new SliceSize(2);
            var sut  = new EventSourceReaderConfiguration(
                StreamNameConversions.PassThru,
                () => null,
                size);

            Assert.Equal(size, sut.SliceSize);
        }
コード例 #2
0
        public void TranslatorFactoryReturnsExpectedResult()
        {
            Func <IStreamEventsSliceTranslator> factory = () => null;

            var sut = new EventSourceReaderConfiguration(
                StreamNameConversions.PassThru,
                factory,
                new SliceSize(1));

            Assert.Same(factory, sut.TranslatorFactory);
        }
コード例 #3
0
        public void ConverterReturnsExpectedResult()
        {
            StreamNameConverter converter = name => name;

            var sut = new EventSourceReaderConfiguration(
                converter,
                () => null,
                new SliceSize(1));

            Assert.Same(converter, sut.Converter);
        }
コード例 #4
0
        public GroupRepository(IEventStoreConnection connection, EventSourceReaderConfiguration readerConfiguration, EventSourceWriterConfiguration writerConfiguration)
        {
            if (connection == null)
            {
                throw new ArgumentNullException(nameof(connection));
            }
            if (readerConfiguration == null)
            {
                throw new ArgumentNullException(nameof(readerConfiguration));
            }
            if (writerConfiguration == null)
            {
                throw new ArgumentNullException(nameof(writerConfiguration));
            }

            _reader = new EventSourceReader(
                Group.Factory,
                connection,
                readerConfiguration);
            _writer = new EventSourceWriter(
                connection,
                writerConfiguration);
        }