|
|
@ -18,7 +18,7 @@ namespace Jellyfin.Model.Tests.Entities
|
|
|
|
[Fact]
|
|
|
|
[Fact]
|
|
|
|
public void HasProviderId_NullProvider_False()
|
|
|
|
public void HasProviderId_NullProvider_False()
|
|
|
|
{
|
|
|
|
{
|
|
|
|
var nullProvider = new ProviderIdsExtensionsTestsObject()
|
|
|
|
var nullProvider = new ProviderIdsExtensionsTestsObject
|
|
|
|
{
|
|
|
|
{
|
|
|
|
ProviderIds = null!
|
|
|
|
ProviderIds = null!
|
|
|
|
};
|
|
|
|
};
|
|
|
@ -47,6 +47,15 @@ namespace Jellyfin.Model.Tests.Entities
|
|
|
|
Assert.True(provider.HasProviderId(MetadataProvider.Imdb));
|
|
|
|
Assert.True(provider.HasProviderId(MetadataProvider.Imdb));
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
[Fact]
|
|
|
|
|
|
|
|
public void HasProviderId_FoundNameEmptyValue_False()
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
var provider = new ProviderIdsExtensionsTestsObject();
|
|
|
|
|
|
|
|
provider.ProviderIds[MetadataProvider.Imdb.ToString()] = string.Empty;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Assert.False(provider.HasProviderId(MetadataProvider.Imdb));
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
[Fact]
|
|
|
|
[Fact]
|
|
|
|
public void GetProviderId_NullInstance_ThrowsArgumentNullException()
|
|
|
|
public void GetProviderId_NullInstance_ThrowsArgumentNullException()
|
|
|
|
{
|
|
|
|
{
|
|
|
@ -68,7 +77,7 @@ namespace Jellyfin.Model.Tests.Entities
|
|
|
|
[Fact]
|
|
|
|
[Fact]
|
|
|
|
public void GetProviderId_NullProvider_Null()
|
|
|
|
public void GetProviderId_NullProvider_Null()
|
|
|
|
{
|
|
|
|
{
|
|
|
|
var nullProvider = new ProviderIdsExtensionsTestsObject()
|
|
|
|
var nullProvider = new ProviderIdsExtensionsTestsObject
|
|
|
|
{
|
|
|
|
{
|
|
|
|
ProviderIds = null!
|
|
|
|
ProviderIds = null!
|
|
|
|
};
|
|
|
|
};
|
|
|
@ -85,7 +94,7 @@ namespace Jellyfin.Model.Tests.Entities
|
|
|
|
[Fact]
|
|
|
|
[Fact]
|
|
|
|
public void TryGetProviderId_NullProvider_False()
|
|
|
|
public void TryGetProviderId_NullProvider_False()
|
|
|
|
{
|
|
|
|
{
|
|
|
|
var nullProvider = new ProviderIdsExtensionsTestsObject()
|
|
|
|
var nullProvider = new ProviderIdsExtensionsTestsObject
|
|
|
|
{
|
|
|
|
{
|
|
|
|
ProviderIds = null!
|
|
|
|
ProviderIds = null!
|
|
|
|
};
|
|
|
|
};
|
|
|
@ -112,6 +121,16 @@ namespace Jellyfin.Model.Tests.Entities
|
|
|
|
Assert.Equal(ExampleImdbId, id);
|
|
|
|
Assert.Equal(ExampleImdbId, id);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
[Fact]
|
|
|
|
|
|
|
|
public void TryGetProviderId_FoundNameEmptyValue_False()
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
var provider = new ProviderIdsExtensionsTestsObject();
|
|
|
|
|
|
|
|
provider.ProviderIds[MetadataProvider.Imdb.ToString()] = string.Empty;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Assert.False(provider.TryGetProviderId(MetadataProvider.Imdb, out var id));
|
|
|
|
|
|
|
|
Assert.Null(id);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
[Fact]
|
|
|
|
[Fact]
|
|
|
|
public void SetProviderId_NullInstance_ThrowsArgumentNullException()
|
|
|
|
public void SetProviderId_NullInstance_ThrowsArgumentNullException()
|
|
|
|
{
|
|
|
|
{
|
|
|
@ -146,7 +165,7 @@ namespace Jellyfin.Model.Tests.Entities
|
|
|
|
[Fact]
|
|
|
|
[Fact]
|
|
|
|
public void SetProviderId_NullProvider_Success()
|
|
|
|
public void SetProviderId_NullProvider_Success()
|
|
|
|
{
|
|
|
|
{
|
|
|
|
var nullProvider = new ProviderIdsExtensionsTestsObject()
|
|
|
|
var nullProvider = new ProviderIdsExtensionsTestsObject
|
|
|
|
{
|
|
|
|
{
|
|
|
|
ProviderIds = null!
|
|
|
|
ProviderIds = null!
|
|
|
|
};
|
|
|
|
};
|
|
|
@ -158,7 +177,7 @@ namespace Jellyfin.Model.Tests.Entities
|
|
|
|
[Fact]
|
|
|
|
[Fact]
|
|
|
|
public void SetProviderId_NullProviderAndEmptyName_Success()
|
|
|
|
public void SetProviderId_NullProviderAndEmptyName_Success()
|
|
|
|
{
|
|
|
|
{
|
|
|
|
var nullProvider = new ProviderIdsExtensionsTestsObject()
|
|
|
|
var nullProvider = new ProviderIdsExtensionsTestsObject
|
|
|
|
{
|
|
|
|
{
|
|
|
|
ProviderIds = null!
|
|
|
|
ProviderIds = null!
|
|
|
|
};
|
|
|
|
};
|
|
|
|