cheap tester circuits incl. most multimeters only check for change in current.
this is why they are unreliable and can be fooled easily - for example just insert
resistor into C and E terminals instead of a transistor and you will see "gain".
imho, this is useless, it is better to build a circuit that does something specific
such as an oscillator for example. for this to work component must have gain.
here is an example of such tester: https://electronics-lab.com/projects/test/002/