Refactored Nix API tests.

Reviewed by: Lauro Neto