Search Unity

Question Troubles with Assembly Definitions

Discussion in 'Testing & Automation' started by robrab2000-aa, Oct 6, 2023.

  1. robrab2000-aa

    robrab2000-aa

    Joined:
    Feb 8, 2019
    Posts:
    117
    Hi, I was to introduce some unit testing to my project. The project is pretty big (roughly 70k lines of code across 561 .cs files) so there is a lot to do .. I'm pretty new to testing but from what I can tell, I need to split the project up into assembly definitions before the tests can recognise the code. I've done this (it's mostly one big assembly with references to external libraries like cinemachine and URP etc) but it looks like some of the serialised references in my prefabs have gotten lost. please see the following screenshots which show this. Did I do this incorrectly or is it just how these things work? (I'm hoping it can be fixed cos there's more than a thousand prefabs to manually go through if not )

    Thanks

    Screenshot 2023-10-06 at 14.06.24.png Screenshot 2023-10-06 at 13.42.28.png
     
  2. robrab2000-aa

    robrab2000-aa

    Joined:
    Feb 8, 2019
    Posts:
    117
    Okay, I fixed it by running a find and replace over all the prefabs substituting `Assembly-CSharp` with the name of my new assembly... this is fine... right... nothing could go wrong with this approach...