What led to the case of Marbury v. Madison?

A.Congress passing the Judiciary Act of 1789
B.The Midnight Judges Act eliminating key federal positions
C.President James Madison issuing a writ of mandamus
D.Adams quickly appointing federal positions at the end of his term