MapTo/test/MapTo.Tests/Infrastructure/TestAnalyzerConfigOptions.cs

19 lines
719 B
C#
Raw Normal View History

2021-12-24 20:06:06 +03:00
using System.Collections.Generic;
using System.Collections.Immutable;
using System.Diagnostics.CodeAnalysis;
using Microsoft.CodeAnalysis.Diagnostics;
namespace MapTo.Tests.Infrastructure
{
internal sealed class TestAnalyzerConfigOptions : AnalyzerConfigOptions
{
private readonly ImmutableDictionary<string, string> _backing;
public TestAnalyzerConfigOptions(IDictionary<string, string>? properties)
{
_backing = properties?.ToImmutableDictionary(KeyComparer) ?? ImmutableDictionary.Create<string, string>(KeyComparer);
}
public override bool TryGetValue(string key, out string? value) => _backing.TryGetValue(key, out value);
}
2021-01-03 12:26:07 +03:00
}