for Push.
This commit is contained in:
@@ -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;
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user