@isTest
|
private class SWOSearchProductContarollerTest {
|
static testMethod void testMethod1() {
|
List<RecordType> rectIE = [select Id from RecordType where IsActive = true and SobjectType = 'Account' and Name = 'Customer IE'];
|
List<RecordType> rectOpp = [select Id from RecordType where IsActive = true and SobjectType = 'Opportunity' and Name = 'SSBD'];
|
Id pricebookId = Test.getStandardPricebookId();
|
|
Pricebook2 pricebook = new Pricebook2(
|
Name = 'IE',
|
ProductSegment__c = 'IE',
|
TradeType__c = 'Taxation',
|
SalesChannel__c = 'direct',
|
MachineParts__c = 'Machine',
|
CurrencyIsoCode = 'CNY'
|
);
|
insert pricebook;
|
|
Product2 product1 = new Product2();
|
product1.Name = 'product1';
|
product1.IsActive = true;
|
product1.ProductCode = 'product1';
|
product1.ProductStatus__c = '1';
|
product1.NMPAStatus_one__c = 'Z1';
|
product1.MaterialStatus_one_Start__c = Date.today().addDays(-22);
|
product1.MaterialStatus_one_End__c = Date.today().addDays(22);
|
|
insert product1;
|
|
PageReference page = new PageReference('/apex/SWOSearchProduct?Type=Quotes&lineno=1&val=product1');
|
System.Test.setCurrentPage(page);
|
SWOSearchProductContaroller controller = new SWOSearchProductContaroller();
|
controller.init();
|
}
|
}
|