mirror of https://github.com/ErsatzTV/ErsatzTV.git
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
48 lines
1.5 KiB
48 lines
1.5 KiB
using Bugsnag; |
|
using ErsatzTV.Core.Domain; |
|
using ErsatzTV.Core.Interfaces.Metadata; |
|
using ErsatzTV.Core.Interfaces.Repositories; |
|
using ErsatzTV.Scanner.Core.Metadata; |
|
using FluentAssertions; |
|
using Microsoft.Extensions.Logging; |
|
using NSubstitute; |
|
using NUnit.Framework; |
|
|
|
namespace ErsatzTV.Scanner.Tests.Core.Metadata; |
|
|
|
[TestFixture] |
|
public class LocalStatisticsProviderTests |
|
{ |
|
[Test] |
|
// this needs to be a culture where '.' is a group separator |
|
[SetCulture("it-IT")] |
|
public void Test() |
|
{ |
|
var provider = new LocalStatisticsProvider( |
|
Substitute.For<IMetadataRepository>(), |
|
Substitute.For<ILocalFileSystem>(), |
|
Substitute.For<IClient>(), |
|
Substitute.For<ILogger<LocalStatisticsProvider>>()); |
|
|
|
var input = new LocalStatisticsProvider.FFprobe( |
|
new LocalStatisticsProvider.FFprobeFormat( |
|
"123.45", |
|
new LocalStatisticsProvider.FFprobeTags( |
|
string.Empty, |
|
string.Empty, |
|
string.Empty, |
|
string.Empty, |
|
string.Empty, |
|
string.Empty, |
|
string.Empty, |
|
string.Empty, |
|
string.Empty, |
|
string.Empty)), |
|
new List<LocalStatisticsProvider.FFprobeStream>(), |
|
new List<LocalStatisticsProvider.FFprobeChapter>()); |
|
|
|
MediaVersion result = provider.ProjectToMediaVersion("test", input); |
|
|
|
result.Duration.Should().Be(TimeSpan.FromSeconds(123.45)); |
|
} |
|
}
|
|
|