I tried looking up but could not find. Is there a way to simulate creating an opportunity from a contact record in a test class (like how we do via the GUI). As you know, this will cause SF to create an Opportunity Contact Role(OCR) by default (before the after-insert trigger on opportunity). If I do create an opp in the test class, it's not creating the OCR and hence that piece of code is not covered under my test class and I'm trying to see if I could cover that too.
Any pointers would be welcome