@@ -18,21 +18,24 @@ namespace Tests.EditMode
1818 /// </summary>
1919 public class MCPToolParameterTests
2020 {
21- [ Test ]
22- public void Test_ManageAsset_ShouldAcceptJSONProperties ( )
21+ private const string TempDir = "Assets/Temp/MCPToolParameterTests" ;
22+
23+ [ SetUp ]
24+ public void SetUp ( )
2325 {
24- // Arrange: create temp folder
25- const string tempDir = "Assets/Temp/MCPToolParameterTests" ;
2626 if ( ! AssetDatabase . IsValidFolder ( "Assets/Temp" ) )
2727 {
2828 AssetDatabase . CreateFolder ( "Assets" , "Temp" ) ;
2929 }
30- if ( ! AssetDatabase . IsValidFolder ( tempDir ) )
30+ if ( ! AssetDatabase . IsValidFolder ( TempDir ) )
3131 {
3232 AssetDatabase . CreateFolder ( "Assets/Temp" , "MCPToolParameterTests" ) ;
3333 }
34-
35- var matPath = $ "{ tempDir } /JsonMat_{ Guid . NewGuid ( ) . ToString ( "N" ) } .mat";
34+ }
35+ [ Test ]
36+ public void Test_ManageAsset_ShouldAcceptJSONProperties ( )
37+ {
38+ var matPath = $ "{ TempDir } /JsonMat_{ Guid . NewGuid ( ) . ToString ( "N" ) } .mat";
3639
3740 // Build params with properties as a JSON string (to be coerced)
3841 var p = new JObject
@@ -70,10 +73,7 @@ public void Test_ManageAsset_ShouldAcceptJSONProperties()
7073 [ Test ]
7174 public void Test_ManageGameObject_ShouldAcceptJSONComponentProperties ( )
7275 {
73- const string tempDir = "Assets/Temp/MCPToolParameterTests" ;
74- if ( ! AssetDatabase . IsValidFolder ( "Assets/Temp" ) ) AssetDatabase . CreateFolder ( "Assets" , "Temp" ) ;
75- if ( ! AssetDatabase . IsValidFolder ( tempDir ) ) AssetDatabase . CreateFolder ( "Assets/Temp" , "MCPToolParameterTests" ) ;
76- var matPath = $ "{ tempDir } /JsonMat_{ Guid . NewGuid ( ) . ToString ( "N" ) } .mat";
76+ var matPath = $ "{ TempDir } /JsonMat_{ Guid . NewGuid ( ) . ToString ( "N" ) } .mat";
7777
7878 // Create a material first (object-typed properties)
7979 var createMat = new JObject
@@ -121,10 +121,7 @@ public void Test_ManageGameObject_ShouldAcceptJSONComponentProperties()
121121 [ Test ]
122122 public void Test_JSONParsing_ShouldWorkInMCPTools ( )
123123 {
124- const string tempDir = "Assets/Temp/MCPToolParameterTests" ;
125- if ( ! AssetDatabase . IsValidFolder ( "Assets/Temp" ) ) AssetDatabase . CreateFolder ( "Assets" , "Temp" ) ;
126- if ( ! AssetDatabase . IsValidFolder ( tempDir ) ) AssetDatabase . CreateFolder ( "Assets/Temp" , "MCPToolParameterTests" ) ;
127- var matPath = $ "{ tempDir } /JsonMat_{ Guid . NewGuid ( ) . ToString ( "N" ) } .mat";
124+ var matPath = $ "{ TempDir } /JsonMat_{ Guid . NewGuid ( ) . ToString ( "N" ) } .mat";
128125
129126 // manage_asset with JSON string properties (coercion path)
130127 var createMat = new JObject
0 commit comments