public override void SetUp() { base.SetUp(); _dataReaderMock = new MockDataReader(base.DataReaderData, InputFile); _dataReader = new BufferedDataReader(_dataReaderMock, BufferSize); }
public override void SetUp() { base.SetUp(); _dataReaderMock = new MockDataReader(_qtData, InputFile); _dataReader = new ByteStreamDataReader(_dataReaderMock, BlockSize); }
public override void SetUp() { base.SetUp(); _dataReaderMock = new MockDataReader(base.DataReaderData, InputFile); _dataReaderPoolMock = new MockDataReaderPool(_dataReaderMock); _dataReader = new FragmentedDataReader(_dataPacket, _dataReaderPoolMock); }
public override void SetUp() { base.SetUp(); _progressReporterMock = MockRepository.GenerateStub <IProgressReporter>(); _dataReaderMock = new MockDataReader(base.DataReaderData, InputFile); _dataReader = new ProgressDataReader(_dataReaderMock, _progressReporterMock); }
private uint GetExpGolombCoded(params byte[] bitstream) { IDataReader dataReader = new MockDataReader(bitstream); var bitStreamDataReader = new BitStreamDataReader(dataReader); INalUnitReader reader = new NalUnitReader(null, bitStreamDataReader, _state); reader.Result = _resultState; return(reader.GetExpGolombCoded()); }
public void TestConstructorDefaultFormat() { using (IDataReader dataReader = new MockDataReader(new byte[DataFileLength], _inputFile)) { IDetector detector = new UnknownFormatDetector(); IScanContext scanContext = TestFramework.CreateScanContext(_project); scanContext.Detectors = new[] { detector }; IDataBlockBuilder builder = TestFramework.CreateDataBlockBuilder(); builder.Detectors = scanContext.Detectors; builder.InputFile = _inputFile; IDataBlock dataBlock = detector.DetectData(dataReader, builder, scanContext); Assert.IsNotNull(dataBlock); IResultNode results = scanContext.Results; Assert.IsNotNull(results); Assert.GreaterOrEqual(results.Children.Count, 1); Assert.AreEqual(0, results.Children[0].Attributes.Count); } }
public void TestDetectData() { using (IDataReader dataReader = new MockDataReader(new byte[DataFileLength], _inputFile)) { IScanContext scanContext = TestFramework.CreateScanContext(_project); scanContext.Detectors = new[] { _detector }; IDataBlockBuilder builder = TestFramework.CreateDataBlockBuilder(); builder.Detectors = scanContext.Detectors; builder.InputFile = _inputFile; IDataBlock dataBlock = _detector.DetectData(dataReader, builder, scanContext); Assert.IsNotNull(dataBlock, "Unknown format detector (DetectData not null)"); IResultNode results = scanContext.Results; Assert.IsNotNull(results, "Unknown format detector (Results not null)"); Assert.AreEqual(_detector, dataBlock.Detectors.First(), "Detector of data block"); Assert.AreEqual(1, results.Children.Count, "One child 'Data'"); IResultNode data = results.Children[0]; Assert.IsEmpty((ICollection)data.Children, "Data has no children"); Assert.AreEqual(0, data.StartOffset, ""); Assert.AreEqual(DataFileLength, data.Length, ""); Assert.IsFalse(data.IsFragmented(), "Single fragment"); Assert.AreEqual(_inputFile, data.InputFile, "Input file"); Assert.IsFalse(dataBlock.IsFullFile, "Does not produce full files"); } }