I am currently programming a trigger on Opportunities.
I created a test class for this and in my Sandbox I created an account, contact and opportunity. When I try to reference them
Opportunity Opp = [SELECT id from Opportunity where name = 'Test1'];
and then start my
Test.startTest();
Opp.StageName = 'PO in (100%)';
update Opp;
Test.stopTest();
It just errors and shows that Opp returns 0 rows. However when I paste my first bit of code in 'Execute Anonymous' it returns a row and the correct info.
Does this mean I have to create an account, contact, quote and all necessary fields in my test class?