diff options
Diffstat (limited to 'win/CS/HandBrake.Interop/HandBrakeInterop.Test')
5 files changed, 0 insertions, 236 deletions
diff --git a/win/CS/HandBrake.Interop/HandBrakeInterop.Test/EncodeJobsPersist.cs b/win/CS/HandBrake.Interop/HandBrakeInterop.Test/EncodeJobsPersist.cs deleted file mode 100644 index 37ca233c4..000000000 --- a/win/CS/HandBrake.Interop/HandBrakeInterop.Test/EncodeJobsPersist.cs +++ /dev/null @@ -1,31 +0,0 @@ -using System;
-using System.Collections.Generic;
-using System.IO;
-using System.Linq;
-using System.Text;
-using System.Xml;
-using System.Xml.Linq;
-using System.Xml.Serialization;
-using HandBrake.Interop;
-using HandBrake.Interop.Model;
-
-namespace HandBrakeInterop.Test
-{
- public static class EncodeJobsPersist
- {
- private static XmlSerializer xmlSerializer = new XmlSerializer(typeof(EncodeJob));
-
- public static EncodeJob GetJob(string jobName)
- {
- XDocument doc = XDocument.Load(jobName + ".xml");
- using (XmlReader reader = doc.CreateReader())
- {
- var job = xmlSerializer.Deserialize(reader) as EncodeJob;
-
-
-
- return job;
- }
- }
- }
-}
diff --git a/win/CS/HandBrake.Interop/HandBrakeInterop.Test/HandBrakeInterop.Test.csproj b/win/CS/HandBrake.Interop/HandBrakeInterop.Test/HandBrakeInterop.Test.csproj deleted file mode 100644 index 5b7a8b72c..000000000 --- a/win/CS/HandBrake.Interop/HandBrakeInterop.Test/HandBrakeInterop.Test.csproj +++ /dev/null @@ -1,68 +0,0 @@ -<?xml version="1.0" encoding="utf-8"?>
-<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
- <PropertyGroup>
- <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
- <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
- <ProductVersion>
- </ProductVersion>
- <SchemaVersion>2.0</SchemaVersion>
- <ProjectGuid>{D721824C-CAFA-40B1-83C9-83E4B1215D60}</ProjectGuid>
- <OutputType>Library</OutputType>
- <AppDesignerFolder>Properties</AppDesignerFolder>
- <RootNamespace>HandBrakeInterop.Test</RootNamespace>
- <AssemblyName>HandBrakeInterop.Test</AssemblyName>
- <TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
- <FileAlignment>512</FileAlignment>
- <ProjectTypeGuids>{3AC096D0-A1C2-E12C-1390-A8335801FDAB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
- </PropertyGroup>
- <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
- <DebugSymbols>true</DebugSymbols>
- <DebugType>full</DebugType>
- <Optimize>false</Optimize>
- <OutputPath>bin\Debug\</OutputPath>
- <DefineConstants>DEBUG;TRACE</DefineConstants>
- <ErrorReport>prompt</ErrorReport>
- <WarningLevel>4</WarningLevel>
- </PropertyGroup>
- <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
- <DebugType>pdbonly</DebugType>
- <Optimize>true</Optimize>
- <OutputPath>bin\Release\</OutputPath>
- <DefineConstants>TRACE</DefineConstants>
- <ErrorReport>prompt</ErrorReport>
- <WarningLevel>4</WarningLevel>
- </PropertyGroup>
- <ItemGroup>
- <Reference Include="Microsoft.VisualStudio.QualityTools.UnitTestFramework, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL" />
- <Reference Include="System" />
- <Reference Include="System.Core">
- <RequiredTargetFramework>3.5</RequiredTargetFramework>
- </Reference>
- <Reference Include="System.Xml" />
- <Reference Include="System.Xml.Linq" />
- </ItemGroup>
- <ItemGroup>
- <CodeAnalysisDependentAssemblyPaths Condition=" '$(VS100COMNTOOLS)' != '' " Include="$(VS100COMNTOOLS)..\IDE\PrivateAssemblies">
- <Visible>False</Visible>
- </CodeAnalysisDependentAssemblyPaths>
- </ItemGroup>
- <ItemGroup>
- <Compile Include="EncodeJobsPersist.cs" />
- <Compile Include="Properties\AssemblyInfo.cs" />
- <Compile Include="TestEncodes.cs" />
- </ItemGroup>
- <ItemGroup>
- <ProjectReference Include="..\HandBrakeInterop\HandBrakeInterop.csproj">
- <Project>{F0A61F62-2C3B-4A87-AFF4-0C4256253DA1}</Project>
- <Name>HandBrakeInterop</Name>
- </ProjectReference>
- </ItemGroup>
- <Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
- <!-- To modify your build process, add your task inside one of the targets below and uncomment it.
- Other similar extension points exist, see Microsoft.Common.targets.
- <Target Name="BeforeBuild">
- </Target>
- <Target Name="AfterBuild">
- </Target>
- -->
-</Project>
\ No newline at end of file diff --git a/win/CS/HandBrake.Interop/HandBrakeInterop.Test/Properties/AssemblyInfo.cs b/win/CS/HandBrake.Interop/HandBrakeInterop.Test/Properties/AssemblyInfo.cs deleted file mode 100644 index 2352dc269..000000000 --- a/win/CS/HandBrake.Interop/HandBrakeInterop.Test/Properties/AssemblyInfo.cs +++ /dev/null @@ -1,35 +0,0 @@ -using System.Reflection;
-using System.Runtime.CompilerServices;
-using System.Runtime.InteropServices;
-
-// General Information about an assembly is controlled through the following
-// set of attributes. Change these attribute values to modify the information
-// associated with an assembly.
-[assembly: AssemblyTitle("HandBrakeInterop.Test")]
-[assembly: AssemblyDescription("")]
-[assembly: AssemblyConfiguration("")]
-[assembly: AssemblyCompany("Microsoft")]
-[assembly: AssemblyProduct("HandBrakeInterop.Test")]
-[assembly: AssemblyCopyright("Copyright © Microsoft 2011")]
-[assembly: AssemblyTrademark("")]
-[assembly: AssemblyCulture("")]
-
-// Setting ComVisible to false makes the types in this assembly not visible
-// to COM components. If you need to access a type in this assembly from
-// COM, set the ComVisible attribute to true on that type.
-[assembly: ComVisible(false)]
-
-// The following GUID is for the ID of the typelib if this project is exposed to COM
-[assembly: Guid("2731c894-c1fc-4690-9557-aa56591b17ab")]
-
-// Version information for an assembly consists of the following four values:
-//
-// Major Version
-// Minor Version
-// Build Number
-// Revision
-//
-// You can specify all the values or you can default the Build and Revision Numbers
-// by using the '*' as shown below:
-[assembly: AssemblyVersion("1.0.0.0")]
-[assembly: AssemblyFileVersion("1.0.0.0")]
diff --git a/win/CS/HandBrake.Interop/HandBrakeInterop.Test/TestEncodes.cs b/win/CS/HandBrake.Interop/HandBrakeInterop.Test/TestEncodes.cs deleted file mode 100644 index 3e625a986..000000000 --- a/win/CS/HandBrake.Interop/HandBrakeInterop.Test/TestEncodes.cs +++ /dev/null @@ -1,102 +0,0 @@ -using System;
-using System.IO;
-using System.Text;
-using System.Collections.Generic;
-using System.Linq;
-using System.Threading;
-using HandBrake.Interop;
-using HandBrake.Interop.Model;
-using HandBrake.Interop.Model.Encoding;
-using Microsoft.VisualStudio.TestTools.UnitTesting;
-
-namespace HandBrakeInterop.Test
-{
- [TestClass]
- public class TestEncodes
- {
- public const string OutputVideoDirectoryName = "OutputVideos";
- private static readonly string OutputVideoDirectory = Path.Combine(Environment.CurrentDirectory, OutputVideoDirectoryName);
-
- private ManualResetEvent resetEvent = new ManualResetEvent(false);
-
- [ClassInitialize]
- public static void Init(TestContext context)
- {
- EnsureOutputVideoDirectoryExists();
-
- FileInfo[] files = new DirectoryInfo(OutputVideoDirectory).GetFiles();
- foreach (FileInfo file in files)
- {
- file.Delete();
- }
- }
-
- [TestMethod]
- public void Normal()
- {
- this.RunJob("Normal");
- }
-
- private void RunJob(string jobName)
- {
- this.resetEvent.Reset();
-
- EncodeJob job = EncodeJobsPersist.GetJob("Normal");
-
- if (job.SourceType == SourceType.VideoFolder)
- {
- job.SourcePath = Path.Combine(Environment.CurrentDirectory, Path.GetFileName(job.SourcePath));
- }
-
- if (job.SourceType == SourceType.File)
- {
- job.SourcePath = Path.Combine(Environment.CurrentDirectory, Path.GetFileName(job.SourcePath));
- } - - string extension; - if (job.EncodingProfile.OutputFormat == Container.Mkv) - { - extension = ".mkv"; - } - else
- {
- extension = ".mp4";
- }
-
- job.OutputPath = Path.Combine(OutputVideoDirectory, jobName + extension);
-
- var instance = new HandBrakeInstance();
- instance.Initialize(0);
- instance.ScanCompleted += (sender, e) =>
- {
- this.resetEvent.Set();
- };
-
- instance.StartScan(job.SourcePath, 10);
- this.resetEvent.WaitOne();
-
- this.resetEvent.Reset();
- instance.EncodeCompleted += (sender, e) =>
- {
- Assert.IsFalse(e.Error);
- this.resetEvent.Set();
- };
-
- instance.StartEncode(job);
- this.resetEvent.WaitOne();
-
- Assert.IsTrue(File.Exists(job.OutputPath));
-
- var fileInfo = new FileInfo(job.OutputPath);
- Assert.IsTrue(fileInfo.Length > 1024);
- }
-
- private static void EnsureOutputVideoDirectoryExists()
- {
- if (!Directory.Exists(OutputVideoDirectory))
- {
- Directory.CreateDirectory(OutputVideoDirectory);
- }
- }
- }
-}
diff --git a/win/CS/HandBrake.Interop/HandBrakeInterop.Test/TestFiles/Jobs/Normal.xml b/win/CS/HandBrake.Interop/HandBrakeInterop.Test/TestFiles/Jobs/Normal.xml Binary files differdeleted file mode 100644 index b717a7c36..000000000 --- a/win/CS/HandBrake.Interop/HandBrakeInterop.Test/TestFiles/Jobs/Normal.xml +++ /dev/null |