There are two things to check, one is Test Plugin of UE should be enabled, the other is the module where your test code lives should be include in uproject file.
If your module exactly is in uproject, maybe you need to regenerate your vs project.
Here is a way to regenerate vs project, which don’t use method of right click uproject
https://forums.unrealengine.com/t/generate-cpp-project-couldnt-find-unrealbuildtool/231288/15?page=3
Basically you run cmd, cd to your UBT folder, run UnrealBuildTool.exe -projectfiles -project="path to your project\project name.uproject" -game -engine -rocket -progress