unity-mcp/TestProjects/UnityMCPTests/Assets/Tests/EditMode/Tools
dsarno f4d62e4da0
Fix material mesh instantiation warnings (#331)
* Editor: prevent material/mesh instantiation in edit mode

- GameObjectSerializer: in edit mode, normalize material/mesh access
  - material -> sharedMaterial
  - materials -> sharedMaterials
  - mesh -> sharedMesh
  - also guard materials/sharedMaterial/sharedMaterials property names
- Tests: add strong instanceID equality checks for Renderer/MeshFilter
  - prove no instantiation by shared instanceID before/after
  - cover multi-material, null cases; prune brittle presence/console tests
- Clean up and relax ManageGameObject tests to avoid false negatives

* Address review: simplify edit-mode guard; include protected/internal [SerializeField]; fix tests to destroy temp primitives and use dictionary access; strengthen instanceID assertions

* Fix resource leaks in test files

- ManageGameObjectTests.cs: Destroy temporary primitive GameObject after extracting sharedMesh
- MaterialMeshInstantiationTests.cs: Destroy instantiated uniqueMesh after test completion

These fixes prevent resource leaks in Unity test files by properly cleaning up temporary objects created during tests.

* Fix reflection bug in GetComponentData tests

- Replace incorrect reflection-based field access with proper dictionary key access
- GetComponentData() returns Dictionary<string, object> where 'properties' is a key, not a field
- Tests now properly access the properties dictionary and run assertions
- Fixes ineffective tests that were silently failing due to reflection returning null
2025-10-20 18:34:33 -07:00
..
AIPropertyMatchingTests.cs Autoformat (#297) 2025-09-30 16:25:33 -04:00
AIPropertyMatchingTests.cs.meta Allow the LLMs to read menu items, not just execute them (#263) 2025-09-12 11:19:58 -04:00
CommandRegistryTests.cs Add testing and move menu items to resources (#316) 2025-10-13 11:16:43 -04:00
CommandRegistryTests.cs.meta Improve Windsurf MCP Config (#231) 2025-08-24 06:57:11 -04:00
ComponentResolverTests.cs Autoformat (#297) 2025-09-30 16:25:33 -04:00
ComponentResolverTests.cs.meta Allow the LLMs to read menu items, not just execute them (#263) 2025-09-12 11:19:58 -04:00
ExecuteMenuItemTests.cs Add testing and move menu items to resources (#316) 2025-10-13 11:16:43 -04:00
ExecuteMenuItemTests.cs.meta Add testing and move menu items to resources (#316) 2025-10-13 11:16:43 -04:00
ManageGameObjectTests.cs Fix material mesh instantiation warnings (#331) 2025-10-20 18:34:33 -07:00
ManageGameObjectTests.cs.meta Allow the LLMs to read menu items, not just execute them (#263) 2025-09-12 11:19:58 -04:00
ManagePrefabsTests.cs Open and close prefabs in the stage view + create them (#283) 2025-09-26 19:28:56 -04:00
ManagePrefabsTests.cs.meta Open and close prefabs in the stage view + create them (#283) 2025-09-26 19:28:56 -04:00
ManageScriptValidationTests.cs Autoformat (#297) 2025-09-30 16:25:33 -04:00
ManageScriptValidationTests.cs.meta fix: address CodeRabbit and Greptile feedback 2025-09-03 16:37:45 -07:00
MaterialMeshInstantiationTests.cs Fix material mesh instantiation warnings (#331) 2025-10-20 18:34:33 -07:00