Exemple #1
0
        private IDataBlock ScanDataBlock(byte[] byteStream, IScanContext scanContext)
        {
            scanContext.Detectors = new[] { _videoDetector };
            IDataBlockBuilder builder = TestFramework.CreateDataBlockBuilder();

            builder.Detectors = scanContext.Detectors;
            var inputFile = _mockRepository.StrictMock <IInputFile>();

            With.Mocks(_mockRepository).Expecting(delegate
            {
                SetupResult.For(inputFile.Name).Return("<ByteArrayDataReader>");
                SetupResult.For(inputFile.Length).Return(byteStream.Length);
            });
            builder.InputFile = inputFile;
            var        mockDataReader = new MockDataReader(byteStream, inputFile);
            IDataBlock dataBlock      = _videoDetector.DetectData(mockDataReader, builder, scanContext);

            Assert.IsNotNull(dataBlock);
            return(dataBlock);
        }