using Microsoft.VisualStudio.TestTools.UnitTesting;
using YMhut.Box.Core;

namespace YMhut.Box.Tests;

[TestClass]
public sealed class SensitiveTextTests
{
    [TestMethod]
    public void SanitizeRemovesInternalRemoteDetails()
    {
        var sanitized = SensitiveText.Sanitize("failed https://update.ymhut.cn/update-info.json?token=abc media-types.json download_url api_url");

        Assert.DoesNotContain("https://", sanitized);
        Assert.DoesNotContain("update.ymhut.cn", sanitized);
        Assert.DoesNotContain("update-info.json", sanitized);
        Assert.DoesNotContain("media-types.json", sanitized);
        Assert.DoesNotContain("download_url", sanitized);
        Assert.DoesNotContain("api_url", sanitized);
        Assert.Contains("远程服务", sanitized);
    }
}
