How does a test-cross help in identifying the genotype of the organism? Explain

Cross between an organism with unknown genotype.
If all offsprings show dominant trait the organism is homozygous if half organism show dominant and half recessive then the organism is heterozygous.