You can test the inlet valve before buying a new one. If you take it off the machine, put an ohmeter across the two terminals. You should get a reading of between 3,500 and 5,000 ohms if it's OK.
If you are very confident you know what you're doing and you haven't got a test-bench then a further check is to re-connect the wires and the hose from the tap, put the valve over the edge of a plastic bucket and set the washer to start -- be really, really careful as it's going to be wet and there's electricity -- stand well back -- make sure the machine is wired through an RCD before turning on from the mains switch. Make sure you've turned the tap right down so that the water pressure is low. If it's working (and you don't electrocute yourself!) the valve should operate and water should come through.
If the valve works then there could be a blockage (fat and hard-water or powder deposits) further inside the machine, depending on the make and model. If the blockage is in an easily removable pipe then it's no problem to shift it but if it's in some of the more complicated plumbing it's tricky!
C Chris
May 2004