Working on mkv unit tests

This commit is contained in:
niksedk 2014-10-04 21:42:33 +02:00
parent 36a5917646
commit 895a461eee
3 changed files with 35 additions and 0 deletions

Binary file not shown.

View File

@ -56,5 +56,37 @@ namespace Test.Logic.VideoFormats
parser.Dispose(); parser.Dispose();
} }
[TestMethod]
public void MatroskaTestVobSubPgs()
{
string fileName = Path.Combine(Directory.GetCurrentDirectory(), "sample_MKV_VobSub_PGS.mkv");
var parser = new Nikse.SubtitleEdit.Logic.VideoFormats.Matroska(fileName);
bool isValid;
var tracks = parser.GetMatroskaSubtitleTracks(fileName, out isValid);
Assert.IsTrue(tracks[0].CodecId == "S_VOBSUB");
Assert.IsTrue(tracks[1].CodecId == "S_HDMV/PGS");
parser.Dispose();
}
[TestMethod]
public void MatroskaTestVobSubPgsContent()
{
string fileName = Path.Combine(Directory.GetCurrentDirectory(), "sample_MKV_VobSub_PGS.mkv");
var parser = new Nikse.SubtitleEdit.Logic.VideoFormats.Matroska(fileName);
bool isValid;
var tracks = parser.GetMatroskaSubtitleTracks(fileName, out isValid);
var subtitles = parser.GetMatroskaSubtitle(fileName, Convert.ToInt32(tracks[0].TrackNumber), out isValid, null);
Assert.IsTrue(subtitles.Count == 2);
//TODO: check bitmaps
//subtitles = parser.GetMatroskaSubtitle(fileName, Convert.ToInt32(tracks[1].TrackNumber), out isValid, null);
//Assert.IsTrue(subtitles.Count == 2);
//check bitmaps
parser.Dispose();
}
} }
} }

View File

@ -78,6 +78,9 @@
<Content Include="Files\sample_MKV_SRT.mkv"> <Content Include="Files\sample_MKV_SRT.mkv">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content> </Content>
<Content Include="Files\sample_MKV_VobSub_PGS.mkv">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<Content Include="Files\sample_TS_with_graphics.ts"> <Content Include="Files\sample_TS_with_graphics.ts">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content> </Content>