Skip to content

Commit d5e46a1

Browse files
committed
テストコードのtextコマンドのrequiredをyamlから削除し、テスト用のTextCommandクラスをoptionalになるように
1 parent c5aeacb commit d5e46a1

3 files changed

Lines changed: 5 additions & 6 deletions

File tree

CommandForgeGenerator.Tests/GenerateSampleTextCommand.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#if ENABLE_COMMAND_FORGE_GENERATOR
1+
#if ENABLE_COMMAND_FORGE_GENERATOR
22
namespace CommandForgeGenerator.Command
33
{
44
public partial class TextCommand : ICommandForgeCommand
@@ -7,20 +7,20 @@ public partial class TextCommand : ICommandForgeCommand
77
public readonly CommandId CommandId;
88

99
public readonly string Character;
10-
public readonly string Body;
10+
public readonly string? Body;
1111

1212

1313
public static TextCommand Create(int commandId, global::Newtonsoft.Json.Linq.JToken json)
1414
{
1515

1616
var Character = (string)json["character"];
17-
var Body = (string)json["body"];
17+
var Body = json["body"] == null ? null : (string)json["body"];
1818

1919

2020
return new TextCommand(commandId, Character, Body);
2121
}
2222

23-
public TextCommand(int commandId, string Character, string Body)
23+
public TextCommand(int commandId, string Character, string? Body)
2424
{
2525
CommandId = (CommandId)commandId;
2626

CommandForgeGenerator.Tests/GenerateTestCode.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,5 +5,5 @@ namespace CommandForgeGenerator.Tests;
55
public class GenerateTestCode
66
{
77
// プロジェクトファイルに存在する GenerateSampleTextCommand.cs を取得する
8-
public static string TextCommandStr => File.ReadAllText("../../../CommandForgeGenerator.Tests/GenerateSampleTextCommand.cs");
8+
public static string TextCommandStr => File.ReadAllText("../../../GenerateSampleTextCommand.cs");
99
}

CommandForgeGenerator.Tests/Test.cs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,6 @@ string GetSampleYaml()
8686
body:
8787
type: string
8888
multiline: true
89-
required: true
9089
9190
- id: emote
9291
label: エモート

0 commit comments

Comments
 (0)