Is it possible to test a network game in a single computer?
The short version is "yes", because you start your server on your computer, then your client, and the server's IP address is 127.0.0.1 (also known as "localhost") as WolRon mentioned.
The catch is that you'll have an almost-perfect network then, and the internet (and even LANs) aren't almost-perfect at all: you have latency guaranteed, and very often packetloss too. Good old BlitzPlay has functions built-in specifically for simulating latency and packetloss especially so you can test on a single computer. Sadly, it would be fairly safe to say now that BlitzPlay is no longer supported (or sold), but I'm sure it's not doing anything any other library couldn't do. Conceptually, that sort of latency/packetloss simulation is quite straightforward...
On another note, you can get the fully commented FPSnet (networked FPS game) from
this entry in the code archives (credit to RottBott), or get the very capable
ROTTnet UDP network library for free from his website directly (also full of other goodies, very generously).
I hope that helps you get started.