修复测试用例错误

This commit is contained in:
zhengxuan.zhang
2026-05-18 15:32:00 +08:00
parent e5cfbf9dd5
commit dcc15f62d1
10 changed files with 88 additions and 174 deletions
@@ -5,7 +5,6 @@ using System.IO;
using System.Linq;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Threading;
using Xunit;
using XP.Common.Logging.Interfaces;
using XplorePlane.Models;
@@ -34,7 +33,6 @@ namespace XplorePlane.Tests.Services
private readonly string _tempConfigDir;
private readonly string _tempConfigPath;
private readonly DebugPanelConfigService _realConfigService;
private readonly Dispatcher _dispatcher;
public DebugPanelIntegrationTests()
{
@@ -65,8 +63,6 @@ namespace XplorePlane.Tests.Services
var configPathField = typeof(DebugPanelConfigService)
.GetField("_configPath", System.Reflection.BindingFlags.NonPublic | System.Reflection.BindingFlags.Instance);
configPathField?.SetValue(_realConfigService, _tempConfigPath);
_dispatcher = Dispatcher.CurrentDispatcher;
}
public void Dispose()
@@ -501,21 +497,5 @@ namespace XplorePlane.Tests.Services
_mockAppStateService.Object,
_mockLoggerService.Object,
_realConfigService);
/// <summary>
/// 处理 Dispatcher 队列中的所有待处理消息
/// Process all pending messages in the Dispatcher queue
/// </summary>
private void DoEvents()
{
var frame = new DispatcherFrame();
_dispatcher.BeginInvoke(DispatcherPriority.Background, new DispatcherOperationCallback(
delegate (object f)
{
((DispatcherFrame)f).Continue = false;
return null;
}), frame);
Dispatcher.PushFrame(frame);
}
}
}