for Push.

This commit is contained in:
nobobo
2026-06-01 13:23:34 +09:00
parent 9e093ea99f
commit a6550e9928
93 changed files with 10393 additions and 0 deletions
@@ -0,0 +1,33 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Text.RegularExpressions;
using System.Threading.Tasks;
namespace KssSmaPlaLib.AutoTest.Script.Parse.Function
{
public class FunctionTryUxer
{
public static bool TryFunction(string input, out string functionName, out List<string> funcArgList,out string resultMessage)
{
functionName = "";
funcArgList = new List<string>();
resultMessage = string.Empty;
var match = Regex.Match(input, @"^(\w+)\((.*?)\)$");
if (match.Success)
{
functionName = match.Groups[1].Value;
var args = match.Groups[2].Value;
if (!string.IsNullOrWhiteSpace(args))
{
funcArgList.AddRange(args.Split(','));
}
return true;
}
resultMessage = $"シグネチャ形式が不正です。[シグネチャ:{input}]";
return false;
}
}
}
+47
View File
@@ -0,0 +1,47 @@
using DocumentFormat.OpenXml.Math;
using KssSmaPlaLib.AutoTest.Command.Alias;
using KssSmaPlaLib.AutoTest.Script.Models;
using KssSmaPlaLib.AutoTest.Script.Parse.Function;
using System.Linq;
using System.Reflection;
namespace KssSmaPlaLib.AutoTest.Script.Parse
{
public static class ParseTryUxer
{
public static bool TryParse(StepDTO raw, out ParsedStepDTO parsed, out string resultMessage)
{
resultMessage = string.Empty;
parsed = new ParsedStepDTO(raw); // Raw注入
// ステップNo
if (string.IsNullOrEmpty(raw.StepNo))
{
resultMessage = $"UIテストステップ:ステップ番号が指定されていません。";
return false;
}
// ステップ情報:シグネチャのバリデーション
if (!FunctionTryUxer.TryFunction(raw.StepText, out var functionName, out var argList, out var messageForMe))
{
resultMessage = $"UIテストステップ:ステップ情報のシグネチャの変換に失敗しました。[エラー内容:{messageForMe}]";
return false;
}
// 関数(機能)名
if (!CommandAliasUxer.TryTranslate(functionName, out var commandEnum))
{
resultMessage = $"UIテストステップ:ステップ情報の関数(機能)名が未登録です。[関数(機能)名:{functionName}]";
return false;
}
// コマンド(enum値)
parsed.Command = commandEnum;
// パラメータ
parsed.Parameters = argList;
return true;
}
}
}