refactor(tests): 重构测试项目的全局引用配置

- 在 GodotYamlConfigLoaderTests 中添加 GFramework.Game.Config 引用
- 从 GodotYamlConfigTableSourceTests 中移除未使用的 System 引用
- 新增 GlobalUsings.cs 文件统一管理所有全局引用
- 将常用的系统命名空间配置为全局引用以减少重复导入
- 优化测试代码的引用管理和项目结构
This commit is contained in:
GeWuYou 2026-04-11 07:39:19 +08:00
parent aedc30cfd2
commit abf78aa934
3 changed files with 30 additions and 10 deletions

View File

@ -1,11 +1,7 @@
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Threading.Tasks;
using GFramework.Game.Abstractions.Config;
using GFramework.Game.Config;
using GFramework.Godot.Config;
namespace GFramework.Godot.Tests.Config;
@ -16,10 +12,6 @@ namespace GFramework.Godot.Tests.Config;
[TestFixture]
public sealed class GodotYamlConfigLoaderTests
{
private string _resourceRoot = null!;
private string _testRoot = null!;
private string _userRoot = null!;
/// <summary>
/// 为每个测试准备独立的资源根目录与用户目录。
/// </summary>
@ -48,6 +40,10 @@ public sealed class GodotYamlConfigLoaderTests
}
}
private string _resourceRoot = null!;
private string _testRoot = null!;
private string _userRoot = null!;
/// <summary>
/// 验证导出态会把注册过的 YAML 与 schema 文本同步到运行时缓存,再交给底层加载器。
/// </summary>

View File

@ -1,4 +1,3 @@
using System;
using GFramework.Godot.Config;
namespace GFramework.Godot.Tests.Config;

View File

@ -0,0 +1,25 @@
// Copyright (c) 2025 GeWuYou
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
global using System;
global using System.Collections.Generic;
global using System.Linq;
global using System.Threading;
global using System.Threading.Tasks;
global using System.Collections.Immutable;
global using Microsoft.CodeAnalysis;
global using NUnit.Framework;
global using System.Globalization;
global using System.IO;
global using System.Text;
global using System.Text.Json;