Added first unit test with external file

This commit is contained in:
niksedk 2014-10-04 20:48:15 +02:00
parent 32ff182bce
commit 3d463eecec
3 changed files with 30 additions and 0 deletions

Binary file not shown.

View File

@ -0,0 +1,23 @@
using Microsoft.VisualStudio.TestTools.UnitTesting;
using System.IO;
namespace Test.Logic.TransportStream
{
[TestClass]
[DeploymentItem("Files")]
public class UnitTest1
{
[TestMethod]
public void TransportStreamTest()
{
string fileName = Path.Combine(Directory.GetCurrentDirectory(), "sample_TS_with_graphics.ts");
var parser = new Nikse.SubtitleEdit.Logic.TransportStream.TransportStreamParser();
parser.ParseTSFile(fileName);
var subtitles = parser.GetDvbSubtitles(41);
Assert.IsTrue(subtitles.Count == 10);
Assert.IsTrue(subtitles[0].Pes.GetImageFull().Width == 719);
Assert.IsTrue(subtitles[0].Pes.GetImageFull().Height == 575);
}
}
}

View File

@ -49,6 +49,7 @@
<Compile Include="Logic\Dictionaries\NamesListTest.cs" />
<Compile Include="Core\HtmlUtilTest.cs" />
<Compile Include="Logic\Dictionaries\OcrFixReplaceListTest.cs" />
<Compile Include="Logic\TransportStream\UnitTest1.cs" />
<Compile Include="Logic\VobSub\VobSubTest.cs" />
<Compile Include="RemoveTextForHearImpairedTest.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
@ -71,6 +72,12 @@
<ItemGroup>
<EmbeddedResource Include="Dictionaries\names_etc.xml" />
</ItemGroup>
<ItemGroup />
<ItemGroup>
<Content Include="Files\sample_TS_with_graphics.ts">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
</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.