On good quality diagnostic equipment, using it to check the instrument cluster, may well show where the fault lies. If it can access the cluster you should be able to read any fault codes and in the live data section, you should get a reading stating how much fuel is left. If you do get a sensible reading it would suggest a cluster fault. Or, access the fuel pump assembly in the tank (petrol engine), lift it out, reconnect and move the fuel level float from empty to full and see if you get corresponding readings on the gauge. if you do not then the sender unit may be faulty.