You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
54 lines
1.5 KiB
54 lines
1.5 KiB
|
4 months ago
|
using X1.Domain.Common;
|
||
|
|
using MediatR;
|
||
|
|
using System.ComponentModel.DataAnnotations;
|
||
|
|
|
||
|
|
namespace X1.Application.Features.ScenarioTestCases.Commands.CreateScenarioTestCase;
|
||
|
|
|
||
|
|
/// <summary>
|
||
|
|
/// 创建场景测试用例命令
|
||
|
|
/// </summary>
|
||
|
|
public class CreateScenarioTestCaseCommand : IRequest<OperationResult<CreateScenarioTestCaseResponse>>
|
||
|
|
{
|
||
|
|
/// <summary>
|
||
|
|
/// 场景ID
|
||
|
|
/// </summary>
|
||
|
|
[Required(ErrorMessage = "场景ID不能为空")]
|
||
|
|
public string ScenarioId { get; set; } = null!;
|
||
|
|
|
||
|
|
/// <summary>
|
||
|
|
/// 测试用例列表
|
||
|
|
/// </summary>
|
||
|
|
[Required(ErrorMessage = "测试用例列表不能为空")]
|
||
|
|
[MinLength(1, ErrorMessage = "至少需要包含一个测试用例")]
|
||
|
|
public List<ScenarioTestCaseItem> TestCases { get; set; } = new();
|
||
|
|
}
|
||
|
|
|
||
|
|
/// <summary>
|
||
|
|
/// 场景测试用例项
|
||
|
|
/// </summary>
|
||
|
|
public class ScenarioTestCaseItem
|
||
|
|
{
|
||
|
|
/// <summary>
|
||
|
|
/// 测试用例流程ID
|
||
|
|
/// </summary>
|
||
|
|
[Required(ErrorMessage = "测试用例流程ID不能为空")]
|
||
|
|
public string TestCaseFlowId { get; set; } = null!;
|
||
|
|
|
||
|
|
/// <summary>
|
||
|
|
/// 执行顺序
|
||
|
|
/// </summary>
|
||
|
|
[Range(0, int.MaxValue, ErrorMessage = "执行顺序必须大于等于0")]
|
||
|
|
public int ExecutionOrder { get; set; } = 0;
|
||
|
|
|
||
|
|
/// <summary>
|
||
|
|
/// 循环次数
|
||
|
|
/// </summary>
|
||
|
|
[Range(1, int.MaxValue, ErrorMessage = "循环次数必须大于0")]
|
||
|
|
public int LoopCount { get; set; } = 1;
|
||
|
|
|
||
|
|
/// <summary>
|
||
|
|
/// 是否启用
|
||
|
|
/// </summary>
|
||
|
|
public bool IsEnabled { get; set; } = true;
|
||
|
|
}
|