can I do test shibboleth IdP and SP on localhost environment?
I have just one PC(Win7)
Yes you sure can.
Download and install SP and idP in that machine, configure metadata for both to communicate to localhost or for better ease use two domains for SP and idP,
C:\Windows\System32\drivers\etc
here add two domains localhost-sp
and localhost-idp
to the hosts
file.
So you have now two differet domains for sp and idp.