2020-01-12 22:57:13 +00:00
|
|
|
using System.IO;
|
|
|
|
using System.Text.Json;
|
|
|
|
using System.Threading.Tasks;
|
2021-06-19 16:02:33 +00:00
|
|
|
using Jellyfin.Extensions.Json;
|
2020-01-12 22:57:13 +00:00
|
|
|
using MediaBrowser.MediaEncoding.Probing;
|
|
|
|
using Xunit;
|
|
|
|
|
|
|
|
namespace Jellyfin.MediaEncoding.Tests
|
|
|
|
{
|
|
|
|
public class FFprobeParserTests
|
|
|
|
{
|
|
|
|
[Theory]
|
|
|
|
[InlineData("ffprobe1.json")]
|
|
|
|
public async Task Test(string fileName)
|
|
|
|
{
|
|
|
|
var path = Path.Join("Test Data", fileName);
|
2021-07-11 20:32:06 +00:00
|
|
|
await using (var stream = File.OpenRead(path))
|
2020-01-12 22:57:13 +00:00
|
|
|
{
|
2021-07-11 20:32:06 +00:00
|
|
|
var res = await JsonSerializer.DeserializeAsync<InternalMediaInfoResult>(stream, JsonDefaults.Options).ConfigureAwait(false);
|
|
|
|
Assert.NotNull(res);
|
2020-01-12 22:57:13 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|