it is easy to test. The sender and connector is above the oil filter. Pull the right rear wheel and you can do some simple tests---alternately grounding the sensor wire and/or unplugging will cause the gauge to go from one extreme to the other. Which will tell you if your wiring and gauge is good.
If so: changing the sender is easy.
If not: you will have to track down the wiring and see if there are shorts or opens....or "high resistance shorts" (aka dirt/grime).
Drew