unity-mcp/TestProjects/UnityMCPTests/Assets/Tests/EditMode
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
..
Data test: remove unused tests for stale file cleanup in Python tools syncing (#327) 2025-10-18 00:56:57 -04:00
Helpers Make it easier to add tools (#301) 2025-10-03 18:53:09 -04:00
Resources Add testing and move menu items to resources (#316) 2025-10-13 11:16:43 -04:00
Services Notify users when there's a new version (#329) 2025-10-18 20:42:18 -04:00
Tools Fix material mesh instantiation warnings (#331) 2025-10-20 18:34:33 -07:00
Windows Make it easier to add tools (#301) 2025-10-03 18:53:09 -04:00
Data.meta Allow users to easily add tools in the Asset folder (#324) 2025-10-18 00:18:25 -04:00
Helpers.meta Add Codex to autoconfig options (#288) 2025-09-26 18:05:30 -04:00
MCPForUnityTests.Editor.asmdef fix: Address CodeRabbit review issues and improve robustness 2025-09-03 08:27:34 -07:00
MCPForUnityTests.Editor.asmdef.meta Rename namespace and public facing plugin output from "Unity MCP" to "MCP for Unity" (#225) 2025-08-20 15:59:49 -04:00
Resources.meta Add testing and move menu items to resources (#316) 2025-10-13 11:16:43 -04:00
Services.meta Allow users to easily add tools in the Asset folder (#324) 2025-10-18 00:18:25 -04:00
Tools.meta Improve Windsurf MCP Config (#231) 2025-08-24 06:57:11 -04:00
Windows.meta Improve Windsurf MCP Config (#231) 2025-08-24 06:57:11 -04:00