public void Command_ResourceManager_Verify() { var command = CommandHelper.CreateCommand(); Assert.Throws <ArgumentNullException>(() => command.InputManager.Add(null)); Assert.Throws <ArgumentException>(() => command.InputManager.AddRange(null)); Assert.Throws <ArgumentNullException>(() => command.InputManager.Insert(0, null)); Assert.DoesNotThrow(() => command.InputManager.Add(CommandInput.Create(Resource.From(Assets.Utilities.GetVideoFile())))); var assetsList = new List <IContainer> { Resource.From(Assets.Utilities.GetVideoFile()), Resource.From(Assets.Utilities.GetVideoFile()) }; var commandList = new List <CommandInput> { CommandInput.Create(assetsList[0]), CommandInput.Create(assetsList[1]) }; Assert.DoesNotThrow(() => command.InputManager.AddRange(commandList)); Assert.DoesNotThrow(() => command.InputManager.Insert(0, CommandInput.Create(Resource.From(Assets.Utilities.GetVideoFile())))); Assert.True(command.Inputs.Count == 4); }
public static FFmpegCommand AddInputNoLoad(this FFmpegCommand command, string fileName) { ValidateInput(command, fileName); var resource = Resource.From(fileName); var commandResource = CommandInput.Create(resource); command.InputManager.Add(commandResource); return(command); }
public static FFmpegCommand AddInput(this FFmpegCommand command, string fileName, SettingsCollection settings) { ValidateInput(command, fileName); var resource = Resource.From(fileName) .LoadMetadata(); var commandResource = CommandInput.Create(resource, settings); command.InputManager.Add(commandResource); return(command); }
public void CommandResource_Verify() { var factory = CommandFactory.Create(); var command = factory.CreateOutputCommand(); var resourceOne = CommandInput.Create(Resource.From(Assets.Utilities.GetVideoFile())); var resourceTwo = CommandInput.Create(Resource.From(Assets.Utilities.GetVideoFile())); var resourceList = new List <CommandInput> { CommandInput.Create(Resource.From(Assets.Utilities.GetVideoFile())), CommandInput.Create(Resource.From(Assets.Utilities.GetVideoFile())) }; var commandResourceManager = CommandInputManager.Create(command); Assert.DoesNotThrow(() => commandResourceManager.Add(resourceOne)); Assert.DoesNotThrow(() => commandResourceManager.AddRange(resourceList)); Assert.DoesNotThrow(() => commandResourceManager.Insert(0, resourceTwo)); Assert.True(command.Inputs.Count == 4); }