Read Exodus 7
God visits plagues against Egypt directly at the gods they worshiped. There are actually several tests going on. The faith of Israel is tested, the obedience of Moses, and God makes an example of Pharaoh. The Nile was the life blood of the land and it was worshiped, obviously water is important to any land and at that time the river was used for commerce and transport. I also find humor in that the Egypt court magicians try to duplicate the plagues.