Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- @isTest static void test(){
- Account acc = new Account();
- acc.Name = 'farah test';
- insert acc;
- Opportunity opp = new Opportunity();
- opp.Name = 'tests';
- opp.CloseDate = Date.today();
- opp.StageName ='Demo';
- opp.AccountId = acc.Id;
- opp.Type='New';
- opp.Demo_Date__c = Date.today();
- opp.New_Vehicle_Feed_Provider__c ='AutoFunds';
- insert opp;
- Product2 p1 = new Product2();
- p1.Family = '360 Suite';
- p1.IsActive = true;
- p1.Name ='360 Suite';
- insert p1;
- Id pricebookId = Test.getStandardPricebookId();
- PricebookEntry pb1 = new PricebookEntry();
- pb1.Product2Id =p1.Id;
- pb1.Pricebook2Id = pricebookId;
- pb1.UnitPrice = 100.00;
- pb1.IsActive = true;
- insert pb1;
- OpportunityLineItem oli = new OpportunityLineItem(
- OpportunityId = opp.Id,
- Quantity = 5,
- PricebookEntryId = pb1.Id,
- TotalPrice = Quantity * pb1.UnitPrice
- );
- insert oli;
- opp.StageName = 'Closed Won';
- update opp;
- }
Add Comment
Please, Sign In to add comment