mirror of
https://github.com/SubtitleEdit/subtitleedit.git
synced 2024-11-22 11:12:36 +01:00
Added first unit test with external file
This commit is contained in:
parent
32ff182bce
commit
3d463eecec
BIN
src/Test/Files/sample_TS_with_graphics.ts
Normal file
BIN
src/Test/Files/sample_TS_with_graphics.ts
Normal file
Binary file not shown.
23
src/Test/Logic/TransportStream/UnitTest1.cs
Normal file
23
src/Test/Logic/TransportStream/UnitTest1.cs
Normal 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);
|
||||
}
|
||||
}
|
||||
}
|
@ -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.
|
||||
|
Loading…
Reference in New Issue
Block a user