高章伟
2022-02-18 8b5f4c6c281cfa548f92de52c8021e37aa81901e
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
@isTest
private class ProductSetTriggerTest {
    static testMethod void myUnitTest() {
 
        Product_Set__c oldpara = new Product_Set__c();
        insert oldpara;
        Product_Set_Detail__c referObj = new Product_Set_Detail__c(
            Product_Set__c = oldpara.Id,
            //Product__c = 'test',
            //Total_price_RMB__c = 66,
            List_price_total_RMB_text__c = 77,
            Quantity__c = 20);
        insert referObj;
 
        Product_Set__c para = new Product_Set__c(RefertoID__c = oldpara.Id);
        insert para;
        List<Product_Set__c> listpara = new List<Product_Set__c> ();
        listpara.add(para);
        ProductSetTrigger.CopyProductSetDetail(listpara,null,null,null);
 
        List<Product_Set_Detail__c> result = [select Product_Set__c, Product_SFDA_Status__c,Product__c,Total_price_RMB__c,
        List_price_total_RMB_text__c,Quantity__c from Product_Set_Detail__c where Product_Set__c =: para.Id];
        system.debug('result===========> '+result);
        System.assertEquals(result[0].Quantity__c, 20);
        //System.assertEquals(result.Product_SFDA_Status__c,  '停止');
    }
}