Refactor and improve causal dict test case.