diff --git a/tests/Recyclarr.TestLibrary/Autofac/StubAutofacIndex.cs b/tests/Recyclarr.TestLibrary/Autofac/StubAutofacIndex.cs index b9b11855..e6ee0344 100644 --- a/tests/Recyclarr.TestLibrary/Autofac/StubAutofacIndex.cs +++ b/tests/Recyclarr.TestLibrary/Autofac/StubAutofacIndex.cs @@ -3,10 +3,11 @@ using Autofac.Features.Indexed; namespace Recyclarr.TestLibrary.Autofac; +[UsedImplicitly] public class StubAutofacIndex : IIndex where TKey : notnull { - private Dictionary _values = new(); + private readonly Dictionary _values = new(); public StubAutofacIndex() { @@ -24,7 +25,10 @@ public class StubAutofacIndex : IIndex public void AddRange(IEnumerable<(TKey, TValue)> pairs) { - _values = _values.Union(pairs.ToDictionary(x => x.Item1, x => x.Item2)).ToDictionary(); + foreach (var (key, value) in pairs) + { + _values[key] = value; + } } public bool TryGetValue(TKey key, [UnscopedRef] out TValue value)