Files
better-genshin-impact/Test/BetterGenshinImpact.UnitTest/CoreTests/RecognitionTests/OCRTests/PaddleCollection.cs
FishmanTheMurloc 40cd76fbdc Feat/multi lan (#1364)
* 多语言下拉框挪到其他设置下

* 使用正经的Fixture写法,杜绝并行测试时paddle崩溃的问题

* 适配不同主城的合成台的不同法语名

* 修正语言资源的正则表达式,好久没用了写错了好多;为AutoDomainTask新增的“地脉异常”、“点击任意位置关闭”添加多语言适配
2025-03-29 12:54:27 +08:00

26 lines
838 B
C#

using BetterGenshinImpact.Core.Recognition.OCR;
using System;
using System.Collections.Concurrent;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace BetterGenshinImpact.UnitTest.CoreTests.RecognitionTests.OCRTests
{
[CollectionDefinition("Paddle Collection")]
public class PaddleCollection : ICollectionFixture<PaddleFixture>
{
}
public class PaddleFixture
{
private readonly ConcurrentDictionary<string, PaddleOcrService> paddleOcrServices = new ConcurrentDictionary<string, PaddleOcrService>();
public PaddleOcrService Get(string cultureInfoName = "zh-Hans")
{
return paddleOcrServices.GetOrAdd(cultureInfoName, name => { lock (paddleOcrServices) { return new PaddleOcrService(name); } });
}
}
}