コード例 #1
0
ファイル: UploadStepTest.cs プロジェクト: GusLab/video-portal
        public void CreateUploadStepTest()
        {
            //Arrange
            var pipelineMediator = new Mock<IStepMediator>();
            var webClient = new Mock<IEncodeWebClient>();
            var storageProvider = new Mock<IFileSystem>();
            var tempFileManager = new Mock<ITempFileManager>();
            var fileWrapper = new Mock<IFileWrapper>();

            var settings = new UploadSettings("backendId");

            //Act
            var pipelineStep = new UploadStep(pipelineMediator.Object, webClient.Object, tempFileManager.Object, settings, storageProvider.Object, fileWrapper.Object);

            //Assert
            Assert.IsInstanceOfType(pipelineStep, typeof(PipelineStepBase<EncodeStepData>));
            Assert.IsInstanceOfType(pipelineStep, typeof(PipelineStepBase<EncodeStepData>));
            pipelineMediator.Verify(m => m.AddUploadStep(pipelineStep), Times.Once());
        }
コード例 #2
0
        public void CreateUploadStepTest()
        {
            //Arrange
            var pipelineMediator = new Mock <IStepMediator>();
            var webClient        = new Mock <IEncodeWebClient>();
            var storageProvider  = new Mock <IFileSystem>();
            var tempFileManager  = new Mock <ITempFileManager>();
            var fileWrapper      = new Mock <IFileWrapper>();

            var settings = new UploadSettings("backendId");

            //Act
            var pipelineStep = new UploadStep(pipelineMediator.Object, webClient.Object, tempFileManager.Object, settings, storageProvider.Object, fileWrapper.Object);

            //Assert
            Assert.IsInstanceOfType(pipelineStep, typeof(PipelineStepBase <EncodeStepData>));
            Assert.IsInstanceOfType(pipelineStep, typeof(PipelineStepBase <EncodeStepData>));
            pipelineMediator.Verify(m => m.AddUploadStep(pipelineStep), Times.Once());
        }
コード例 #3
0
ファイル: UploadStepTest.cs プロジェクト: GusLab/video-portal
        public void Initialize()
        {
            var settings = new UploadSettings(UserId);
            var stepData = new EncodeStepData()
            {
                EncoderState = EncoderState.Completed,
                ContentType = ContentType
            };

            _pipelineMediator = new Mock<IStepMediator>();
            _webClient = new Mock<IEncodeWebClient>();
            _fileSystem = new Mock<IFileSystem>();
            _tempFileManager = new Mock<ITempFileManager>();
            _fileWrapper = new Mock<IFileWrapper>();
            _tokenSource = new Mock<CancellationTokenSourceWrapper>();

            _pipelineStep = new UploadStep(_pipelineMediator.Object, _webClient.Object, _tempFileManager.Object, settings, _fileSystem.Object, _fileWrapper.Object);

            _tempFileManager.Setup(m => m.GetEncodingTempFilePath()).Returns(LocalFileUri);
            
            _pipelineStep.SetData(stepData);
        }
コード例 #4
0
        public void Initialize()
        {
            var settings = new UploadSettings(UserId);
            var stepData = new EncodeStepData()
            {
                EncoderState = EncoderState.Completed,
                ContentType  = ContentType
            };

            _pipelineMediator = new Mock <IStepMediator>();
            _webClient        = new Mock <IEncodeWebClient>();
            _fileSystem       = new Mock <IFileSystem>();
            _tempFileManager  = new Mock <ITempFileManager>();
            _fileWrapper      = new Mock <IFileWrapper>();
            _tokenSource      = new Mock <CancellationTokenSourceWrapper>();

            _pipelineStep = new UploadStep(_pipelineMediator.Object, _webClient.Object, _tempFileManager.Object, settings, _fileSystem.Object, _fileWrapper.Object);

            _tempFileManager.Setup(m => m.GetEncodingTempFilePath()).Returns(LocalFileUri);

            _pipelineStep.SetData(stepData);
        }
コード例 #5
0
ファイル: UploadStatus.cs プロジェクト: uxifiit/UXC
 private UploadStatus(UploadStep step, bool isIndeterminate)
 {
     Step            = step;
     IsIndeterminate = isIndeterminate;
 }