Пример #1
0
 public CorruptedDataTests()
 {
     _data       = new byte[1024];
     _stream     = new MemoryStream(_data);
     _fooLogger  = new FooLogger(_stream, new byte[128]);
     _logDecoder = new LogDecoder(128, new IChannelDecoder[] { new FooDecoder(new CustomArgumentDecoder()) });
 }
Пример #2
0
        public TracerTests()
        {
            _stream = new MemoryStream(1024);

            _tracer  = new SampleTracer();
            _logger  = new FooLogger(_stream, new byte[64], _tracer);
            _decoder = new LogDecoder(128, new IChannelDecoder[] { new FooDecoder(new CustomArgumentDecoder()) });
        }
Пример #3
0
        public void BadStreamTest()
        {
            Assert.Throws <BinLogException>(() => new FooLogger(new MockStream(), new byte[16]));

            var emptyDecoder = new LogDecoder(42, new IChannelDecoder[] {});

            Assert.Throws <BinLogException>(() => emptyDecoder.Decode(new MockStream()).First());
        }
Пример #4
0
        public EncodeDecodeTests()
        {
            var buffer = new byte[128];

            _fooLogger = new FooLogger(_stream, buffer);
            _barLogger = new BarLogger(_stream, buffer);

            var argDecoder = new CustomArgumentDecoder();

            _fooDecoder = new FooDecoder(argDecoder);
            _barDecoder = new BarDecoder(argDecoder);
            _logDecoder = new LogDecoder(128, new IChannelDecoder[] { _fooDecoder, _barDecoder });
        }