|
|
|
@ -90,6 +90,20 @@ namespace NzbDrone.Core.Test.MediaFiles.MediaInfo.MediaInfoFormatterTests
|
|
|
|
|
MediaInfoFormatter.FormatAudioChannels(mediaInfoModel).Should().Be(5.1m);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
[Test]
|
|
|
|
|
public void should_handle_AudioChannelPositions_three_digits()
|
|
|
|
|
{
|
|
|
|
|
var mediaInfoModel = new MediaInfoModel
|
|
|
|
|
{
|
|
|
|
|
AudioChannels = 2,
|
|
|
|
|
AudioChannelPositions = "3/2/0.2.1",
|
|
|
|
|
AudioChannelPositionsText = null,
|
|
|
|
|
SchemaRevision = 3
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
MediaInfoFormatter.FormatAudioChannels(mediaInfoModel).Should().Be(7.1m);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
[Test]
|
|
|
|
|
public void should_cleanup_extraneous_text_from_AudioChannelPositions()
|
|
|
|
|
{
|
|
|
|
@ -132,6 +146,20 @@ namespace NzbDrone.Core.Test.MediaFiles.MediaInfo.MediaInfoFormatterTests
|
|
|
|
|
MediaInfoFormatter.FormatAudioChannels(mediaInfoModel).Should().Be(7.1m);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
[Test]
|
|
|
|
|
public void should_sum_first_series_of_numbers_from_AudioChannelPositions_with_three_digits()
|
|
|
|
|
{
|
|
|
|
|
var mediaInfoModel = new MediaInfoModel
|
|
|
|
|
{
|
|
|
|
|
AudioChannels = 2,
|
|
|
|
|
AudioChannelPositions = "3/2/0.2.1 / 3/2/0.1",
|
|
|
|
|
AudioChannelPositionsText = null,
|
|
|
|
|
SchemaRevision = 3
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
MediaInfoFormatter.FormatAudioChannels(mediaInfoModel).Should().Be(7.1m);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
[Test]
|
|
|
|
|
public void should_sum_dual_mono_representation_AudioChannelPositions()
|
|
|
|
|
{
|
|
|
|
@ -173,21 +201,5 @@ namespace NzbDrone.Core.Test.MediaFiles.MediaInfo.MediaInfoFormatterTests
|
|
|
|
|
|
|
|
|
|
MediaInfoFormatter.FormatAudioChannels(mediaInfoModel).Should().Be(5.1m);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
[Test]
|
|
|
|
|
public void should_warn_unknown_AudioChannelPostions()
|
|
|
|
|
{
|
|
|
|
|
var mediaInfoModel = new MediaInfoModel
|
|
|
|
|
{
|
|
|
|
|
AudioChannels = 2,
|
|
|
|
|
AudioChannelPositions = "3/2/0.2.1",
|
|
|
|
|
AudioChannelPositionsText = null,
|
|
|
|
|
SchemaRevision = 3
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
MediaInfoFormatter.FormatAudioChannels(mediaInfoModel).Should().Be(2m);
|
|
|
|
|
|
|
|
|
|
ExceptionVerification.ExpectedWarns(1);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|