today we had a speech about test in company. so i think, there must be some fancy test tool for unity. here is what i learned in it:
1.assertion component can be used when you want to test when something happens, you can set assertion like value>50 and open error pause in console, then when value decrease to 50, it will pause.
2.debug value with assertion component means you don’t need to add code and delete later, you don’t need to add a lot of break point if you have that value changed at a lot of places.
3.can control all assertions in assertion explorer
4.integrate test is test on another scene and test how things work together.
Need to add test and each test is separate. They have different scene
First way to test is a call test, set when to pass and when the fail.
Second way is write script, use IntegrationTest.Pass(gameObject) or fail to set the result.
Third way is add assertion on gameObject in the test, and check succeed on assertion. So as long as all assertion succeed, it pass.
The reason we need the complex integrate test is for future when things get complicated and people might mess something up, the test will help them know they might do something wrong.
5.in integrate test, the timeout means, if in this time, it’s not passed, then fail it.
6.when add integrate test, might add that on a separate gameobject so easy to find out.
7.unit test is for code specifically.
8.add unit test is in asset/create/editor test, and see all unit tests are in window/editor test
9.use assert… to pass/fail a unit test.