Rav said: Abraham our father kept the entire Torah, all of it, as it is said, "because Abraham obeyed My voice [and kept My charge, My commandments, My statutes, and My laws]" (Genesis 26:5). One might say [he kept only] the seven [Noahide] commandments and circumcision. If so, why does it say "My commandments, My statutes, and My laws"? Abraham kept even the law of the commingling of cooked dishes [eruv tavshilin, a rabbinic ordinance for cooking on a festival before the Sabbath], as it is said "My laws" [in the plural] one [referring to] the words of the written Torah, and one [referring to] the words of the scribes [the rabbinic teachings].
Abraham Kept the Whole Torah Before It Was Given
Yalkut Shimoni on Torah 111:9
אָמַר רַב קִיֵּים אַבְרָהָם אָבִינוּ כָּל הַתּוֹרָה כֻּלָּהּ שֶׁנֶּאֱמַר עֵקֶב אֲשֶׁר שָׁמַע אַבְרָהָם בְּקֹלִי וְגוֹ', וְאֵימָא שֶׁבַע מִצְוֹת וּמִילָה, אִם כֵּן מִצְוֹתַי חֻקּוֹתַי וְתוֹרֹתָי לָמָּה לִי. קִיֵּים אַבְרָהָם אֲפִילוּ עֵרוּבֵי תַּבְשִׁילִין שֶׁנֶּאֱמַר תוֹרֹתָי, אֶחָד דִּבְרֵי תּוֹרָה, וְאֶחָד דִּבְרֵי סוֹפְרִים.