using XFEEDToolBox.Services; using XFEExtension.NetCore.XUnit.Attributes; namespace XFEEDToolBox.Test; [TestFixture]public class KnownTranslationStartupNoticeTests { private static StartupNoticeControl[] Controls=>[new(2,"Button","确定"),new(20,"Static",""),new(65535,"Static", "EliteDangerous汉化补丁已加载\r\n\r\n本补丁由TowaNoah及EliteDangerous中文汉化组制作免费发布\r\n\r\n如果你是通过付费渠道获取的本补丁,请举报退款,倒卖必究")]; [Test]public void ExactObservedInformationalDialogMatchesWithLineEndingDifferences() =>Check.That(KnownTranslationStartupNotice.Matches("提示","#32770",Controls)); [Test]public void ErrorsChoicesDifferentDialogClassesAndChangedInstructionsArePreserved() { Check.That(!KnownTranslationStartupNotice.Matches("错误","#32770",Controls)); Check.That(!KnownTranslationStartupNotice.Matches("提示","Other",Controls)); Check.That(!KnownTranslationStartupNotice.Matches("提示","#32770",[..Controls,new(3,"Button","取消")])); var changed=Controls;changed[2]=changed[2] with{Text="EliteDangerous汉化补丁已加载\n出现错误,需要用户选择"}; Check.That(!KnownTranslationStartupNotice.Matches("提示","#32770",changed)); var other=Controls;other[0]=other[0] with{Id=1};Check.That(!KnownTranslationStartupNotice.Matches("提示","#32770",other)); } }