public void EncodeScreenshostTaskTest() { //Arrange var taskData = new EncodeTaskData() { TaskId = TaskId }; var encodeData = new ScreenshotEncodeData() { FileId = ConfigurationManager.AppSettings.Get("TestVideo"), ContentType = "image/jpeg", ScreenshotParam = new ScreenshotParam() { TimeOffset = 1 } }; var serializer = new JsonSerializer(); var jsonEncodeData = serializer.Serialize(encodeData); var jsonTaskData = serializer.Serialize(taskData); var getTaskHeaders = ScreenshotGetTaskResponseHeaders(Resource); ResponseSetup(jsonTaskData, jsonEncodeData, getTaskHeaders); RestClientSetup(Resource); //Act var task = _manager.Start(); task.Wait(); Trace.WriteLine(_deleteRequest.Parameters.FirstOrDefault(p => p.Name == EncoderStatusParameters.Result).Value); //Assert Assert.IsTrue(_deleteRequest.Parameters.Any(p => p.Name == EncoderStatusParameters.Result && (EncoderState)p.Value == EncoderState.Completed)); }
public ScreenshotEncodeStringBuilder(ScreenshotEncodeData encodeData, IScreenshotEncodeStringFactory screenshotEncodeStringFactory, ITempFileManager tempFileManager) : base(encodeData) { _encodeData = encodeData; _screenshotEncodeStringFactory = screenshotEncodeStringFactory; _tempFileManager = tempFileManager; }
public void Initialize() { _encodeData = new ScreenshotEncodeData() { ScreenshotParam = new ScreenshotParam() { TimeOffset = TimeOffset, VideoRotation = VideoRotation } }; }
public void CreateScreenshotEncodeCreatorTest() { //Arrange var encodeData = new ScreenshotEncodeData(); var creatorFactory = new EncodeCreatorFactory(); //Act var creator = creatorFactory.Create(encodeData); //Assert Assert.IsInstanceOfType(creator, typeof(ScreenshotEncodeCreator)); }
public void CreateEncodeStringFactoryTest() { //Arrange var encodeData = new ScreenshotEncodeData(); var screenshotEncodeCreator = new ScreenshotEncodeCreator(encodeData); //Act var encodeStringFactory = screenshotEncodeCreator.CreateEncodeStringFactory(); //Assert Assert.AreEqual(typeof(ScreenshotEncodeStringFactory), encodeStringFactory.GetType()); }
public void CreateFfmpegParserTest() { //Arrange var encodeData = new ScreenshotEncodeData(); var screenshotEncodeCreator = new ScreenshotEncodeCreator(encodeData); var tempFileCreator = new Mock <ITempFileManager>(); //Act var snapshotFfmpegString = screenshotEncodeCreator.CreateFfmpegParser(); //Assert Assert.AreEqual(typeof(ScreenshotFfmpegParser), snapshotFfmpegString.GetType()); }
public void CreateEncodeStringBuilderTest() { //Arrange var encodeData = new ScreenshotEncodeData(); var screenshotEncodeCreator = new ScreenshotEncodeCreator(encodeData); var encodeStringFactory = new Mock <IScreenshotEncodeStringFactory>(); var tempFileManager = new Mock <ITempFileManager>(); //Act var encodeStringBuilder = screenshotEncodeCreator.CreateEncodeStringBuilder(tempFileManager.Object, encodeStringFactory.Object); //Assert Assert.AreEqual(typeof(ScreenshotEncodeStringBuilder), encodeStringBuilder.GetType()); }
public void ScreenshotDataDeserializeTest() { //Arrange const TypeOfTask typeOfType = TypeOfTask.Screenshot; var deserializer = new Mock <IDeserializer>(); var response = new Mock <IRestResponse>(); var encodeDeserializer = new EncodeDeserializer(deserializer.Object); var data = new ScreenshotEncodeData(); deserializer.Setup(m => m.Deserialize <ScreenshotEncodeData>(response.Object)).Returns(data); //Act var encodeData = encodeDeserializer.EncodeDataDeserialize(response.Object, typeOfType); //Assert Assert.AreEqual(data, encodeData); }
public ScreenshotEncodeCreator(ScreenshotEncodeData data) { _data = data; }