using Jellyfin.Plugin.Multilang.Services.Injection; using Microsoft.Extensions.Logging.Abstractions; namespace Jellyfin.Plugin.Multilang.Tests; public sealed class WebScriptInjectorTests : IDisposable { private const string Shell = "
"; private const string OtherBlock = "\n\n\n"; private readonly string _root = Path.Combine(Path.GetTempPath(), "web-inject-test-" + Guid.NewGuid().ToString("N")); private string Index => Path.Combine(_root, "index.html"); public WebScriptInjectorTests() { Directory.CreateDirectory(_root); File.WriteAllText(Index, Shell); } [Fact] public void ReplacingShorterScriptPreservesOtherPluginAndRepeatedInjectionDoesNotWrite() { File.WriteAllText(Index, Shell.Replace("