@isTest
public with sharing class ProRegisterHandlerTest {

    static testMethod void Test01() {
        System.Test.startTest();
        //ProRegisterHandler prh = new ProRegisterHandler();
        Product_Register__c PRC = new Product_Register__c();
        PRC.Name = '国械注进20183222249';
        PRC.MedPrdClass__c = '3';
        PRC.RegisterNoClass_New__c = '';
        PRC.RegisterNoClass_Old__c = '6822';
        PRC.PrdCompanyAddr__c = '名称:奥林巴斯医疗株式会社;住所:日本国东京都涩谷区幡之谷二丁目43番地2号;联系方式:0081-426-42-2667';
        PRC.RegisterNoStatus__c = '有效';
        PRC.ValidTo__c = Date.today();
        insert PRC;
        

        Product2__c product2 = new Product2__c();
        product2.Name = 'WD18100A';
        insert product2;

        Product2 pro = new Product2();
        pro.Name = 'A00507A:密封圈,  透明, 黑色';
        pro.MDM_Model_No__c = 'A00507A';
        //pro.Register_Latest__c  = 'a2wp0000000QYv3AAG';
        pro.Brand_Name__c = '奥林巴斯';
        pro.SFDA_Approbation_No__c = '国械注进20162220210';
        pro.SFDA_Approbated_Date__c = Date.valueOf('2016-05-19');         
        pro.SFDA_Expiration_Date__c = Date.valueOf('2021-01-23');    
        pro.ProduceCompany__c = '名称:奥林巴斯苇音特和意北公司;住所:Kuehnstr.6122045 汉堡德国;联系方式:0049-40-66966-0';
        pro.SFDA_Approbated_Status__c = '有效';
        pro.RegisterNo_ALL__c  = '国械注进20162220210';
        insert pro;

        Product_Register_Link__c prl = new Product_Register_Link__c();
        prl.Product2__c = pro.ID;
        prl.Product_Register__c = PRC.ID;
        insert prl; 

        update PRC;
        
        System.Test.stopTest();
    }

    static testMethod void Test02() {
        System.Test.startTest();
        Product_Register__c PRC = new Product_Register__c();
        PRC.Name = '国械注进20183222249';
        PRC.MedPrdClass__c = '3';
        PRC.RegisterNoClass_New__c = '';
        PRC.RegisterNoClass_Old__c = '6822';
        PRC.PrdCompanyAddr__c = '名称:奥林巴斯医疗株式会社;住所:日本国东京都涩谷区幡之谷二丁目43番地2号;联系方式:0081-426-42-2667';
        PRC.RegisterNoStatus__c = '有效';
        PRC.ValidTo__c = Date.today();
        insert PRC;
        

        Product2__c product2 = new Product2__c();
        product2.Name = 'WD18100A';
        insert product2;

        Product2 pro = new Product2();
        pro.Name = 'A00507A:密封圈,  透明, 黑色';
        pro.MDM_Model_No__c = 'A00507A';
        //pro.Register_Latest__c  = 'a2wp0000000QYv3AAG';
        pro.Brand_Name__c = '奥林巴斯';
        pro.SFDA_Approbation_No__c = '国械注进20162220210';
        pro.SFDA_Approbated_Date__c = Date.valueOf('2016-05-19');         
        pro.SFDA_Expiration_Date__c = Date.valueOf('2021-01-23');    
        pro.ProduceCompany__c = '名称:奥林巴斯苇音特和意北公司;住所:Kuehnstr.6122045 汉堡德国;联系方式:0049-40-66966-0';
        pro.SFDA_Approbated_Status__c = '有效';
        pro.RegisterNo_ALL__c  = '国械注进20162220210';
        insert pro;
        
        Product_Register_Link__c prl = new Product_Register_Link__c();
        prl.Product2__c = pro.ID;
        prl.Product_Register__c = PRC.ID;
        insert prl; 
        //ProRegisterHandler prh = new ProRegisterHandler();
        update PRC;
       
        System.Test.stopTest();
    }
}