Combine verify calls

Co-authored-by: Claus Vium <cvium@users.noreply.github.com>
This commit is contained in:
Joe Rogers 2022-01-16 14:18:44 +01:00 committed by Joe Rogers
parent b03f56c3d6
commit 6bf71c0fd3
No known key found for this signature in database
GPG Key ID: 0074AD57B8FDBBB4

View File

@ -87,14 +87,8 @@ namespace Jellyfin.Providers.Tests.Manager
Assert.Equal(ItemUpdateType.MetadataDownload, actual.Result);
for (var i = 0; i < servicesList.Length; i++)
{
if (i == expectedIndex)
{
servicesList[i].Verify(mock => mock.RefreshMetadata(It.IsAny<BaseItem>(), It.IsAny<MetadataRefreshOptions>(), It.IsAny<CancellationToken>()), Times.Once());
}
else
{
servicesList[i].Verify(mock => mock.RefreshMetadata(It.IsAny<BaseItem>(), It.IsAny<MetadataRefreshOptions>(), It.IsAny<CancellationToken>()), Times.Never());
}
var times = i == expectedIndex ? Times.Once() : Times.Never();
servicesList[i].Verify(mock => mock.RefreshMetadata(It.IsAny<BaseItem>(), It.IsAny<MetadataRefreshOptions>(), It.IsAny<CancellationToken>()), times);
}
}