- 为平台测试添加EntityFrameworkCore和Xunit引用 - 实现PlatformTestDb创建带审计字段自动填充的测试数据库 - 添加DictionaryConfiguration支持配置值获取测试 - 实现完整的密码强度验证规则 - 添加RAG问答全链路端到端测试 - 创建多个Stub服务用于解耦外部依赖测试 - 实现测试专用的当前用户上下文
13 lines
440 B
C#
13 lines
440 B
C#
using BuildFlow.Shared.Domain.Common;
|
|
|
|
namespace BuildFlow.Rag.Tests.Stub;
|
|
|
|
/// <summary>
|
|
/// 测试用当前用户上下文。UserId 必须非空且非 "system",否则 GetRequiredUserId 抛 UnauthorizedException。
|
|
/// </summary>
|
|
public sealed class TestCurrentUserContext : ICurrentUserContext
|
|
{
|
|
public string UserId { get; init; } = "11111111-1111-1111-1111-111111111111";
|
|
public string IPAddress { get; init; } = "127.0.0.1";
|
|
}
|