We develop a model where a genetic test reveals whether an individual has a low or high probabiliTY of developing a disease. Testing is not mandatory, but agents have to reveal their test results to the insurers, facing a discrimination risk. A costly prevention effort allows agents with a genetic predisposition to decrease their probabiliTY to develop the disease. We study the individual decisions to take the test and to undertake the prevention effort as a function of the effort cost and of its efficiency. If effort is observable by insurers, agents undertake the test only if the effort cost is neither too large nor too small. If the effort cost is not observable by insurers, moral hazard increases the value of the test if the effort cost is low. We offer several policy recommendations, from the optimal breadth of the tests to policies to do away with the discrimination risk.