unity-mcp/TestProjects/UnityMCPTests/Assets
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
..
Scenes Set up Unit tests (#220) 2025-08-15 21:24:55 -04:00
Scripts Autoformat (#297) 2025-09-30 16:25:33 -04:00
Tests Fix material mesh instantiation warnings (#331) 2025-10-20 18:34:33 -07:00
Editor.meta feat: Automatic Background Compile and Domain Reload for MCP Script Edits and New Script Creation (#248) 2025-09-02 09:36:50 -07:00
Scenes.meta Set up Unit tests (#220) 2025-08-15 21:24:55 -04:00
Scripts.meta Set up Unit tests (#220) 2025-08-15 21:24:55 -04:00
Tests.meta Set up Unit tests (#220) 2025-08-15 21:24:55 -04:00