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.
36 lines
915 B
36 lines
915 B
1 year ago
|
using Recyclarr.Cli.Pipelines.Tags;
|
||
|
using Recyclarr.Cli.Pipelines.Tags.PipelinePhases;
|
||
8 months ago
|
using Recyclarr.ServarrApi.Tag;
|
||
1 year ago
|
|
||
1 year ago
|
namespace Recyclarr.Cli.Tests.Pipelines.Tags.PipelinePhases;
|
||
1 year ago
|
|
||
|
[TestFixture]
|
||
|
[Parallelizable(ParallelScope.All)]
|
||
|
public class TagApiFetchPhaseTest
|
||
|
{
|
||
|
[Test, AutoMockData]
|
||
|
public async Task Cache_is_cleared_and_updated(
|
||
|
[Frozen] ISonarrTagApiService api,
|
||
|
[Frozen] ServiceTagCache cache,
|
||
|
TagApiFetchPhase sut)
|
||
|
{
|
||
|
var expectedData = new[]
|
||
|
{
|
||
|
new SonarrTag {Id = 3},
|
||
|
new SonarrTag {Id = 4},
|
||
|
new SonarrTag {Id = 5}
|
||
|
};
|
||
|
|
||
|
api.GetTags(default!).ReturnsForAnyArgs(expectedData);
|
||
|
|
||
|
cache.AddTags(new[]
|
||
|
{
|
||
|
new SonarrTag {Id = 1},
|
||
|
new SonarrTag {Id = 2}
|
||
|
});
|
||
|
|
||
|
await sut.Execute(default!);
|
||
|
cache.Tags.Should().BeEquivalentTo(expectedData);
|
||
|
}
|
||
|
}
|